VS2010: How to change a “Class Library” project into a “Test Project”

Whilst working with VS2010 projects it can be really frustrating if you accidentally create your unit testing projects as class libraries (or migrate an existing class library into a unit testing library mainly because the context-sensitive “Add New” menu no longer contains the “New Test” option.  This can be easily fixed by directly amending the project file, adding the following key to the main tag:

<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

Reload the project in VS2010 and now your class library has become a testing library and you have “Add New Test” option(s) back again.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *