使用 regasm 进行位于 UNC 共享的框架 4.0 程序集
我正在尝试使用 regasm 实用程序注册 .Net 4.0 编译的二进制文件。此 ComInterOp 组件必须部署在网络共享上,并且尝试从共享注册失败,并出现错误“无法加载文件或程序集或依赖项之一”。 (如果二进制文件位于本地驱动器上,则注册有效)。可能是代码访问安全问题,有没有办法为framework 4.0程序集设置它?我尝试过 4.0 框架附带的 Caspol.exe,但没有帮助。
I am trying to register a .Net 4.0 compiled binary using regasm utillity. This ComInterOp assemply has to be deployed on a network share, and trying to register from the share fails with the error "Cound not load file or assembly or one of the dependecies". (registration works if the binary is on a local drive). It may be Code access security issue, is there a way to set it for framework 4.0 assembly? I have tried Caspol.exe that ships with 4.0 framework but it did not help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这实际上是由于安全设置造成的。最简单的解决方案是更改 regasm.config 文件以包含 loadFromRemoteSources 元素,以便信任网络共享:
http://msdn.microsoft.com/en-us/library/dd409252(VS.100).aspx
This is in fact due to security settings. The easiest solution is to change the regasm.config file to include the loadFromRemoteSources element so that the network share will be trusted:
http://msdn.microsoft.com/en-us/library/dd409252(VS.100).aspx