Click here to Skip to main content
15,886,025 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I would like to have the Add->View... context menu item available in a project that starts out as a class library, just as it is available in a project that starts out as an MVC 4 project. I have given the .csproj file a cursory read through, but I don't see anything saying, "This is an MVC project", so how does VS know this?
Posted

1 solution

I'm not sure I understand your question, but all the VS templates are stored in the Visual Studio directories. You can create your own or modify the existing ones (see my article about Visual C++ Express). However, if you have the full version of Visual Studio you can create new templates from existing projects.

[edit]
VS does not know what type of project it is, it just has a set of files to be compiled and a set of commands to link the objects or combine them into a library or DLL. This information is held in the .csproj file which is then used by msbuild to generate the actual compilation/linker/ lib commands.
[/edit]
 
Share this answer
 
v2
Comments
Brady Kelly 6-Dec-12 9:19am    
Richard, I'm trying to find out how VS knows what item templates to make available in what project types. I'll check the built-in templates, thanks, in the hope that the project template is some sort of container for a list of available item templates/wizards.
Richard MacCutchan 6-Dec-12 11:32am    
The templates are just grouped together in trees with control files etc, so when you select New Project, it just lists them according to which language or framework you have chosen. Then once you make the further choices in the wizard, it generates the project from a load of skeleton files, using HTML and Javascript. If you want to read my article it gives a general idea of how it all works. Item templates will again be selected based on the project type information which is held in the project properties and saved in .csproj.
Brady Kelly 6-Dec-12 12:15pm    
I'm busy with your article now. It looks like a fine piece of work. If I were you, I'd include a link wherever I recommend someone reads it.
Richard MacCutchan 6-Dec-12 13:08pm    
Yes, I should have pasted the link there, sorry; just being a lazy so-and-so.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900