在 app.config 中指定 .net 程序集绑定/融合的搜索路径?
我有一个依赖于其他 .net 程序集的应用程序。当我启动应用程序时,出现错误,无法加载程序集或其依赖项之一。
我不想将程序集放入 GAC 或应用程序目录中。有没有办法(app.config?)告诉.net在尝试加载程序集时查看给定的路径?我相信我可以对单个程序集使用程序集绑定,但我正在寻找通配符解决方案来添加“搜索路径”的路径
I have an application that depends on other .net assemblies. When I start the application, I get an error that an assembly or one of its dependencies cannot be loaded.
I do not want to put the assemblies into the GAC or into the Directory of the application. Is there a way (app.config?) to tell .net to look into a given path when trying to load assemblies? I believe I can use assembly binding for a single assembly, but I'm looking for a wildcard solution to add a path to the "search paths"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,它并不像告诉应用程序应该在哪里找到程序集那么简单。有固定的算法用于确定探测程序集的位置以及给予它们的信任。位置是程序集证据的一部分,因此有助于提高其信任级别。苏珊·库克(Suzanne Cook)就此发表了几篇内容非常丰富的帖子;查看:
选择绑定上下文
http://blogs.msdn.com/suzcook/archive/2003/05/29/57143.aspx
-Oisin
Unfortunately it's not as simple as just telling an application where it should find assemblies. There are fixed algorithms for determining what locations are probed for assemblies, and also for the trust that given to them. Location is a part of an assembly's evidence, and as such contributes towards its trust level. Suzanne Cook posted a couple of really meaty posts on this; check out:
Choosing a Binding Context
http://blogs.msdn.com/suzcook/archive/2003/05/29/57143.aspx
-Oisin