简体   繁体   English

Web Api在临时ASP.Net文件中引用旧程序集

[英]Web Api referencing old assemblies in temporary ASP.Net files

I have a Silverlight client that's hosted in an ASP.Net Web Api. 我有一个托管在ASP.Net Web Api中的Silverlight客户端。 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\\ AppData \\ Local \\ Temp \\临时ASP.Net文件\\

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. 我检查了web.config中的所有引用,清理了所有.Net临时文件夹,清理了解决方案,然后重新构建,但是问题仍然存在。 I've also deleted my bin\\ and obj\\ folders just to make sure but same error. 我也删除了bin \\和obj \\文件夹,只是为了确保但出现相同的错误。

Can anyone guide me on how to solve this? 谁能指导我如何解决这个问题?

There are 2 options for the issue you described: 您描述的问题有2个选项:

  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. 需要将新的WebApi.dll复制到bin目录中,并且您的web.config不应包含版本,区域性和PublicKeyToken详细信息。 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. 您的新WebApi.dll必须位于GAC (C:\\ Windows \\ Assembly)中,并且您的web.config应该至少包含一个有效的PublicKeyToken。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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