C# ImageResizer库:除非重建项目,否则插件无法加载

C# ImageResizer库:除非重建项目,否则插件无法加载,c#,asp.net-mvc-4,imageresizer,C#,Asp.net Mvc 4,Imageresizer,我正在ASP.NET MVC 4项目中使用(3.2.4版),并带有以下插件:水印、MVCroudingShim、DiskCache和SimpleFilter 当我第一次在Visual Studio 2012中启动该项目时,一切正常 但在停止并重新启动项目2或3次后,插件无法加载,这在诊断页面中得到确认: (...) Plugins(ConfigurationError): Failed to load plugin by name "Watermark" Verify the plugi

我正在ASP.NET MVC 4项目中使用(3.2.4版),并带有以下插件:水印、MVCroudingShim、DiskCache和SimpleFilter

当我第一次在Visual Studio 2012中启动该项目时,一切正常

但在停止并重新启动项目2或3次后,插件无法加载,这在诊断页面中得到确认:

(...)
Plugins(ConfigurationError):    Failed to load plugin by name "Watermark"
 Verify the plugin DLL is located in /bin, and that the name is spelled correctly. 

Plugins(ConfigurationError):    Failed to load plugin by name "MvcRoutingShim"
  Verify the plugin DLL is located in /bin, and that the name is spelled correctly. 
(...) etc.
DLL文件位于\bin文件夹中

我可以通过在VisualStudio中执行项目的“清理”操作,然后“重建”来修复该问题


但是为什么插件在一段时间后无法加载呢?

很可能VS在构建代码中未引用的依赖项方面表现得很懒惰

尝试从代码中引用DLL,而不是仅从Web.config引用,这可能会有所帮助

将以下代码放入应用程序\u Start:

new WatermarkPlugin().Install(Config.Current); 
查看诊断页面上是否仍显示缺少水印