简体   繁体   中英

Web Api referencing old assemblies in temporary ASP.Net files

I have a Silverlight client that's hosted in an ASP.Net Web Api. If I run my project I get the following:

服务器错误

I have recently restructured and cleaned up my solution but broke a couple of references which I managed to fix again. Clearly I missed something - why is the project referencing a file from the

AppData\\Local\\Temp\\Temporary ASP.Net Files\\

directory which is using an old assembly name?

I've checked all references in web.config, cleaned up all my .Net temp folders, cleaned my solution and rebuilt however the problem persists. I've also deleted my bin\\ and obj\\ folders just to make sure but same error.

Can anyone guide me on how to solve this?

There are 2 options for the issue you described:

  1. The new WebApi.dll needs to be copied over in your bin directory and your web.config should not include, version, culture and PublicKeyToken details. or

  2. Your new WebApi.dll needs to be in the GAC (C:\\Windows\\Assembly) and your web.config should contain at least a valid PublicKeyToken.

不幸的是,我唯一可以召集的解决方案是重新创建Web项目。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM