1

我在 ASP.NET MVC 4 项目中使用ImageResizer 库(版本 3.2.4),并带有以下插件:Watermark、MvcRoutingShim、DiskCache 和 SimpleFilters。

当我第一次在 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 文件夹中。

我可以通过在 Visual Studio 中执行项目的“清理”操作,然后“重建”来解决问题。

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

4

1 回答 1

0

VS 很可能懒于构建代码中未引用的依赖项。

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

将以下代码放入 Application_Start:

new WatermarkPlugin().Install(Config.Current); 

查看水印是否仍然在诊断页面上显示为丢失。

于 2013-01-21T03:44:48.223 回答