我正在CMS MVC 4應用程序使用MEF加載插件在運行時。但每當程序調用:MVC 4:不兼容的版本DotNetOpenAuth與System.Web.Mvc導致繼承安全規則違反類型
DirectoryCatalog dirCatalog = new DirectoryCatalog(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "bin"));
它會導致dirCatalog.Parts此錯誤:
Inheritance security rules violated by type: 'DotNetOpenAuth.Messaging.OutgoingWebResponseActionResult'. Derived types must either match the security accessibility of the base type or be less accessible.
我DotNetOpenAuth.Core版本是4.3.0.0 和DotNetOpenAuth.AspNet版本是4.3.0.0是當我們在Visual Studio中創建新的MVC 4項目時的默認版本。
我的System.Web.Mvc版本是5.2.3.0。
如果我在我的Web.config中將我的System.Web.Mvc版本更改爲4.0.0.0,則dirCatalog.Parts不會產生錯誤,但是在代碼嘗試調用控制器時會產生此錯誤:
Inheritance security rules violated by type: 'System.Web.Mvc.MvcWebRazorHostFactory'. Derived types must either match the security accessibility of the base type or be less accessible.
我猜DotNetOpenAuth版本與我的MVC版本不兼容。有沒有一種解決方法來匹配這個?
有'OutgoingWebResponseActionResult'類似的問題,這裏是做什麼http://idevexplorer.com/2014/12/dotnetopenauth-usage-and-implementation-in-mvc-5/(看第8步的他們的教程)。不幸的是,如果您直接使用操作結果,如何解決此問題,您必須找到一種方法在您的方案中應用此解決方法。 –