部署时出现 MVCContrib 部分受信任的程序集安全错误

发布于 2024-10-05 12:01:00 字数 893 浏览 0 评论 0原文

我正在我的应用程序中实现 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甩你一脸翔 2024-10-12 12:01:00

该错误消息具有误导性。问题是由于程序集在从网络下载后被“阻止”。

右键单击每个程序集,然后单击“取消阻止”。

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".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文