2013-01-21 68 views
1

我在ASP.NET MVC 4項目中使用ImageResizer library(版本3.2.4),其中包含以下插件:Watermark,MvcRoutingShim,DiskCache和SimpleFilters 。ImageResizer庫:插件無法加載,除非項目被重建

當我第一次在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中執行項目的「清理」操作,然後「重建」來解決此問題。

但是爲什麼插件一段時間後無法加載?

回答

0

這很可能是VS懶惰構建的依賴沒有在代碼中引用。

嘗試從代碼而不是從Web.config引用DLL,它可能會有所幫助。

刪除下面的代碼的Application_Start:

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

看看水印仍然顯示診斷頁面失蹤。

相關問題