How can I get my Web API app to run again after upgrading to MVC 5 and Web API 2?

后端 未结 2 1682
悲哀的现实
悲哀的现实 2021-01-02 23:30

I upgraded my Web API app to the funkelnagelneu versions using this guidance:

http://www.asp.net/mvc/tutorials/mvc-5/how-to-upgrade-an-aspnet-mvc-4-and-web-api-proj

相关标签:
2条回答
  • 2021-01-03 00:15

    In the last step on the migration guide did you delete only the MVC4 Project Guid that is specified? I had the same problem as you and when I retraced my steps realised that I had deleted all three of the Guids within in my .csproj file. I restored the other Guids within this element and the solution now recognises it as a MVC application and now works OK. So the line now reads:

    <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
    

    Hope that helps

    0 讨论(0)
  • 2021-01-03 00:23

    I recently ran into this problem, but it was a simple fix. I have multiple projects in my solutions (including several shared PCLs) and when I unloaded the project to change the ProjectTypeGuids, it set a PCL as the default. Right-clicking over my web service project and setting it back to the default startup project fixed it and everything is working.

    0 讨论(0)
提交回复
热议问题