Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change a Visual Studio project type?

I finally figured out that Visual Studio keeps track of how you create a project (in other words which project template you select initially) and filters your options later based on that initial decision. The information is kept in the *.csproj file as a <ProjectTypeGuids> element.

Other than just editing the *.csproj file, is there a "right" way to change a project type for an existing project?

Considering the significance of that setting it seems likely there's a place in the GUI to change it, but I couldn't find one. Thanks!

like image 481
Scott Bussinger Avatar asked Oct 11 '09 19:10

Scott Bussinger


People also ask

How do I change my Visual Studio project?

In Visual Studio, click Tools > Options. Expand Projects and Solutions and click Locations. The Projects location field defines the default location for storing new projects. You can change this path if you are using a different working folder.

How do I know the project type in Visual Studio?

If you are working in Visual Studio, you can quickly check the project format using one of the following methods: Right-click the project in Solution Explorer and select Edit myprojectname. csproj. This option is only available starting in Visual Studio 2017 for projects that use the SDK-style attribute.


1 Answers

Small correction: Visual Studio does not keep track of the project template used to create a project. The project system is largely unaware of the initial template used for a project. There are several items in the project system (Project Type for instance) which have the same name as specific templates but this is a coincidence and the two are not definitively corrected.

The only thing that can really be changed in terms of the project type is essentially the output type. This can have value Class Library, Console Application and Windows Application. You can change this by going to the project property page (right click Properties) and change the Output Type combo box.

It is possible to have other project types supported by the project system but they are fairly few and are not definitively associated with a project template.

like image 95
JaredPar Avatar answered Sep 23 '22 17:09

JaredPar