How does Visual Studio know the type of a project?

When you click on the “Create unit tests” or “Create private accessor” options in Visual Studio, it will give you a list of your unit-test projects to create it in. But how does it know which of your projects are unit-tests? Similarly, how does it know that a project is a setup project, or a console application?

The answer, it turns out, is actually very simple. In the project file (.csproj, or .vbproj), there will be an XML element called “ProjectTypeGuid“. Setting the value of that element to any one of the GUIDs found in this list will change it’s project type.

The value is a semi-colon separated list, so you can set multiple different project types on a single project.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s