Icon of project in Visual Studio - visual-studio

I want certain projects in my solution opened in Visual Studio have different icons..Just like how Visual Studio displays different icons for class project, web site project etc
I am not talking about changing the icon of the winforms or other such app being produced
I understand I should arrange my code into proper namespaces / folder structure...and can even arrange the project into solution folders...but above will communicate better to my teammate for time being...(unfortunately we have inherited a reasonable code base and things needs to be cleaned along further development)

If you look in your SLN file, the project has a guid assigned to it.
all the c# projects have
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}")
and all the build folders have ..
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}")
These define the project type, which you can hunt down in your registry ....
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Projects
With this finding, I would say what you are looking for is VERY possible, but you'll have to create custom project types for visual studio. This may not be as daunting as it sounds, if you start with on of the default packages.
Here is a pointer to a sample, where in fact they mention setting the custom icon in step 3.
Building a Custom Project Wizard in Visual Studio .NET

Related

Deploy a VSPackage to create a new project type using Setup Project

I create a new custom project type using a VSPackage project inheriting of MPF library (http://mpfproj11.codeplex.com/). As a result I obtain a .vsix but I need add this project type using a .msi. I'm using the Visual Studio 2010 Setup projet for it. In my setup project I add the content of the VS Package in the same directory where the .vsix put then, but I think Ineed to put in the registre the new type of project because when I use the setup , the project template does not come out in Visual Studio and when I give double click the file with extension of the type of new project and does not recognize it. When I look the registry after install the vsix, this was one of the things that I found diferent. I add this entries in my setup project but It's not working yet.I'm missing something else?
In the projecttemplatedir is the directory where I put the .dll of the project type, the vsixmifest and pkgdef. The project template is in [User]\Documents\Visual Studio 2013\Templates\ProjectTemplates\[Name of new Project Type]\[projecttemplate.zip]
Best Regards
PS: The project type is for VS 2013 but I'm using the VS 2010 Setup project ;)
OK, so first the "don't"s of doing this:
In general, if you are installing via MSI you shouldn't be doing anything user-specific -- no writing in HKEY_CURRENT_USER, nor writing within their Documents folder, LocalAppData, or Visual Studio folders, etc. If you see yourself writing files or registry keys in either of those places, that should be your hint that there's a better way to do what you're trying to do. For what you've shown so far, this raises more than a few red flags for me.
Second, don't ever go writing keys into 12.0_Config. That part of the hive is nothing more than a cache that's built up from other parts of the registry and on-disk .pkgdef files from extensions. It's rebuilt in any number of senarios, including installing new extensions. Any writes there you should presume will get blown away at any time. If you need to write things there you should either (a) write in HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\[version] and run devenv /setup or (2) [preferred] put your keys in a .pkgdef inside your extension which gets merged into 12.0_Config for you automatically.
Now the dos:
You said you already had a .vsix produced by the SDK: you can put project templates in there. You can then register those templates in the .vsixmanifest and those will pull in. That's far easier than mucking around with files in Documents -- that's the user's directory...don't go playing with that.
Once you have a .vsix that does most of what you need, you should simply take the files within that and install the files in a folder within C:\Program Files [(x86)]\Microsoft Visual Studio 12.0\Common7\IDE\Extensions. Even better, you might just want to WiX toolset to build your installer, since it has built-in support for installing extensions. It also has built-in support for invoking the "/setup" process if that's what you need to do as well. Visual Studio Setup projects are no longer supported in newer versions of Visual Studio, so you're better off starting with a technology that isn't already obsolete. WiX is even what we use at Microsoft to do the setup work for Visual Studio itself, so it's definitely up to the task.
Last point: almost everything when it comes to Visual Studio extensibility can be done with a VSIX directly, so presume there's a good way to do something that way before falling back to an MSI. Internally, we can register the entire C# and VB language services with just a VSIX -- they're quite powerful.
I found the answer in this link Registering Project and Item Templates. I set projecttemplatedir entry with
[User]\Documents\Visual Studio 2013\Templates\ProjectTemplates[Name of new Project Type][projecttemplate.zip] that is where i put the project template.

Precompile a asp.net4 mvc3 website using visual studio 2010

What is the best way to pre-compile a asp.net4 mvc3 website with all its view files using visual studio 2010?
I'm a little confused because MS provides multiple solutions that sound very similar.
Web Deployment Projects
http://blogs.msdn.com/b/webdevtools/archive/2010/05/26/visual-studio-2010-web-deployment-projects-rtw-available-now.aspx
Web Deployment Tool
http://www.microsoft.com/download/en/details.aspx?id=25230
or can I just do all this from the default VS2010 SP1 without additional addons?
Can someone clarify?
When you build or publish your project, the website is already compiled. Only the views are dynamically compiled. If you want your views to be compiled also, you can edit your web project file. Change this line:
<MvcBuildViews>false</MvcBuildViews>
to:
<MvcBuildViews>true</MvcBuildViews>
To be able to edit the project file within visual studio you have to unload the project first (right-click, Unload Project) and then right click the project again and choose Edit Project.
When you made the change, your views will be automatically be build also.
This is not something you want to do during development, build time significantly increases.

Solution file vs. Project file in Visual Studio

Can someone briefly explain to me the difference between Visual Studio's solution file (.sln) and project file (.vcproj).
It seems to me opening either one open the correct solution/project in Visual Studio. Is one the super-set of the other?
Note: I am currently using Visual Studio 2008 working on a project that was brought forward from Visual Studio 2005 (I believe).
A solution is a set of projects. If you need more than one project in your software, then go with solutions. I.E.: A Class Library Project + A Web Application Project.
A project file typically corresponds to a single module: EXE or DLL or LIB. A solution manages a collection of project files.
A solution is a collection of projects. Visual Studio is made so that it cannot function without a solution, so if you open a bare project, it will generate the solution automatically (or try to find one).
One solution can contain zero or more projects. Everything is in projects, so a solution with zero projects doesn't contain anything at all besides the solution properties.
Visual studio keeps track of where the projects are used, so if you open a project file, it will open (IIRC) the last solution where it was used.
When you create a project from scratch, a solution is also created, but it's not shown until you add another project to it. It looks like you have only the project open, but it's actually a solution containing the project that is open.
Specifically project files are intended to contain the data required to build the files in the project into an exe or dll. This file is utilized by the local compilers or with systems such as Team Foundation system and server side build agents.
Solutions are a client (IDE) construct designed to manage collections of projects, which in effect is a collection of different build definitions and associated files.
Solution files are typically made up of multiple project files.

How do I create Visual Studio shortcut files

In Visual Studio there is a way to have a file in another project that is a shortcut to the first so that it builds in both. How do I do that?
Right-click the project, select Add > Existing Item, and in the dialog drop down the Add button and select Add As Link.
This is not a direct answer but an alternative that may be worth considering in some cases.
You can create a specific kind of project which can "include" a set of files in another project when it is added by reference. This is called a Shared Project which is one of the 'new project' options:
(Since at least Visual Studio 2015 - maybe earlier).
One advantage of this type of project over individual shortcuts is that it includes a set of things as a bundle. So if you have a large # of items, this may be easier and less error prone.
Also it uses the familiar "reference" metahphor in the context of the solution and in that way functions quite similarly to other project references; the difference is that in a shared project the items in the project are added into each referring project, but in a normal project the assemblies (DLLs) end up owning the reference at runtime. Shortcuts may be less familiar to other developers than the reference pattern.
More information: What is the difference between a Shared Project and a Class Library in Visual Studio 2015?
Are you talking about a solution with multiple projects? In that case answer would be using Project Dependencies (within Project menu).

How can I tell Visual Studio I have code not in App_Code folder?

We've been using Visual Studio 2005 Team Suite for a fairly large web project. Now, we're adding another web app into our current project...it is essentially complete, and we're just adding the entire thing as a folder into our current project. The project builds, runs...everything is fine...but this new sub-project doesn't have any kind of Intellisense that recognizes the classes we've created for this sub-project.
I think that this is probably because the code for the project isn't in the App_Code folder, and so Visual Studio doesn't know where to find it. Does that make sense? If so, what can I do about it?
As fas as I know, that's just the way it is. For some reason, the default template for web apps in 2005 does it like this. If you just need small stuff, making the classes not in App_Code implement an interface, and then just use this when you interact with your code that reside somewhere outside of App_Code (for whatever reasons).
Otherwise, you can choose to use a different project model (doesn't ship with 2005, so need to be installed seperatly, and conversion could be non-trivial):
http://webproject.scottgu.com/CSharp/Migration2/Migration2.aspx

Resources