部署时出现 MVCContrib 部分受信任的程序集安全错误
我正在我的应用程序中实现 MVCContrib 的 Castle ControllerFactory。它似乎在我的本地计算机上运行得很好,但它在我的 Web 服务器(MS Server 2008)上抛出 SecurityExceptions。
[SecurityException: That assembly does not allow partially trusted callers.]
MvcContrib.Castle.WindsorExtensions.RegisterControllers(IWindsorContainer container, Type[] controllerTypes) +0
MvcContrib.Castle.WindsorExtensions.RegisterControllers(IWindsorContainer container, Assembly[] assemblies) +36
InteractiveToolsBuilder.MvcApplication.IntializeControllers() in C:\Dev\Team Interactive Tools\trunk\Infrastructure\Manufacturing\InteractiveToolsBuilder\Global.asax.cs:58
InteractiveToolsBuilder.MvcApplication.Application_Start() in C:\Dev\Team Interactive Tools\trunk\Infrastructure\Manufacturing\InteractiveToolsBuilder\Global.asax.cs:64
我已在 web.config 中添加了以下信任级别,即使 Web 服务器似乎以“完全”信任级别运行。
有人能告诉我如何克服这个问题吗?
I am implementing MVCContrib's Castle ControllerFactory in my application. It seems to work great on my local machine but it is throwing SecurityExceptions at my web server (MS Server 2008).
[SecurityException: That assembly does not allow partially trusted callers.]
MvcContrib.Castle.WindsorExtensions.RegisterControllers(IWindsorContainer container, Type[] controllerTypes) +0
MvcContrib.Castle.WindsorExtensions.RegisterControllers(IWindsorContainer container, Assembly[] assemblies) +36
InteractiveToolsBuilder.MvcApplication.IntializeControllers() in C:\Dev\Team Interactive Tools\trunk\Infrastructure\Manufacturing\InteractiveToolsBuilder\Global.asax.cs:58
InteractiveToolsBuilder.MvcApplication.Application_Start() in C:\Dev\Team Interactive Tools\trunk\Infrastructure\Manufacturing\InteractiveToolsBuilder\Global.asax.cs:64
I have added the following trust level in the web.config even though it appears that the web server is running with with "Full" level of trust.
Can someone tell me how to overcome this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该错误消息具有误导性。问题是由于程序集在从网络下载后被“阻止”。
右键单击每个程序集,然后单击“取消阻止”。
The error message was misleading. The problem was due to the fact that the assemblies where "blocked" after downloading them from the web.
Right Click each assembly and click, "unblock".