Ninject mvc3无法从程序集中加载WebActivator.ApplicationShutdownMethodAttribute

4
我正在使用Ninject为MVC3开发ASP.NET MVC 3应用程序。当我尝试运行应用程序时,出现了这个错误。我关闭了Cassini服务器并重新运行VS调试器,但错误仍然存在。之前它是可以工作的,也曾经出现过此类情况,但我不知道它是如何再次开始工作的。我不确定这是否是随机发生的。
我知道发生了什么事情,就是我让电脑休眠了一下,然后又尝试重新加载网站时遇到了这个错误。我还没有重启电脑。
错误信息如下: Could not load type 'WebActivator.ApplicationShutdownMethodAttribute' from assembly 'WebActivator, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. 在Visual Studio中,我看到了以下内容:
Locating source for 'D:\Code\Bitbucket\WebActivator\WebActivator\PreApplicationStartCode.cs'. Checksum: MD5 {ca d6 fb 32 7f 34 6 22 5d 1f 1a 40 37 e8 da 47}
The file 'D:\Code\Bitbucket\WebActivator\WebActivator\PreApplicationStartCode.cs' does not exist.
Looking in script documents for 'D:\Code\Bitbucket\WebActivator\WebActivator\PreApplicationStartCode.cs'...
Looking in the projects for 'D:\Code\Bitbucket\WebActivator\WebActivator\PreApplicationStartCode.cs'.
The file was not found in a project.
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\VC\crt\src\'...
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc\'...
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\src\atl\'...
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\VC\atlmfc\include\'...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: D:\Code\Bitbucket\WebActivator\WebActivator\PreApplicationStartCode.cs.
The debugger could not locate the source file 'D:\Code\Bitbucket\WebActivator\WebActivator\PreApplicationStartCode.cs'.
1个回答

9

您部署了错误的WebActivator版本。需要版本1.4。


引用文件夹中的 DLL 显示:版本号:1.4.1.0 - Shawn Mclean
1
参考文件夹中的内容并不重要。问题是部署/加载了什么。使用Fusion日志来检查加载了什么并将其更改为正确的版本。 - Remo Gloor
你可以尝试检查一下你的包文件夹里有哪些版本,我移除了旧版本并重新构建了解决方案。这导致了一些构建错误,在添加对最新版本WebActivator的引用后,它又开始工作了。看起来是由于引用了不同版本的WebActivator所致。 - wullinkm

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接