当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - WebApi is referencing unknown namespace in IIS Express only

问题描述:

When I try to debug a WebApi project in Visual Studio locally with IIS Express, I suddenly started getting the following error:

"ExceptionMessage": "Multiple controller types were found that match the URL.

This can happen if attribute routes on multiple controllers match the requested URL.

The request has found the following matching controller types:

MyApp.Api.Controllers.ProfileController

MyApp.Web.Controllers.ProfilesController"

When I publish the solution to my IIS instance, there is no issue. In the very beginning I did have a MyApp.Web namespace, but that has long since been gone and I can't find any references to it anywhere. MyApp.Api is the correct one.

This just started happening tonight. I tried cleaning & rebuilding with no success. Any ideas?

网友答案:

Per @LexLi Deleted all files from the /bin folder which still had the .Web dlls hanging around in there. Problem solved.

分享给朋友:
您可能感兴趣的文章:
随机阅读: