A project with an Output Type of Class Library can

2019-01-27 13:44发布

When I try to run my application, I ge the the following error; enter image description here

I know this issue has come up many times, and the usual answer is to right click on the appropriate project and make it the start up project.

Well I have done that and this does not fix it.

My application is an MVC application, so the start up project should be a class library.

It was working fine until I tried to upgrade it to MVC5.

I am working on VS 2012.

I am wondering if the problem was caused by unloading and reloading the csproj file which I edited as part of the upgrade?

2条回答
啃猪蹄的小仙女
2楼-- · 2019-01-27 13:53

I think it might have something to do if there are multiple projects in the solution. I was getting the same problem when I had a MVC project and the testing project in the same solution. What fixed it for me was setting the MVC project as the StartUp project. This is done by right clicking on the MVC project and selecting "Set as StartUp Project".

This works for VS2013 Professional

查看更多
做个烂人
3楼-- · 2019-01-27 14:00

I had the same issue and corrected by altering the projecttype guid. Here is an example:

<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
查看更多
登录 后发表回答