Click here to Skip to main content
13,043,877 members (48,110 online)
Rate this:
Please Sign up or sign in to vote.
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 6-Dec-12 2:18am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.

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.
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 6 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100