Unity 中的装配分辨率
我有一个托管在 IIS 中的 WCF 服务项目。主 SVC 文件位于 Web 应用程序文件夹的根目录中,bin\ 文件夹中是实际的 dll。 web.config(也在根目录中)包含所有统一映射。不幸的是,似乎因为具体程序集等位于 bin\ 文件夹中,所以 Unity 无法找到它们。
Unity 配置文件中是否有一种方法可以指定 DLL 可能所在的路径(有点像探测),或者以某种方式将该路径放入映射本身中?如果我们可以避免的话,我实际上不想修改 machine.config 等中的探测路径。
我查看了 MSDN 并谷歌搜索,但找不到任何帮助。
有什么想法吗?
I have a WCF service project hosted in IIS. The main SVC file is in the root of the web application folder, and in the bin\ folder are the actual dlls. The web.config (also in the root) contains all the unity mappings. Unfortunately, it seems that because the concrete assemblies etc. are living in the bin\ folder, Unity cannot find them.
Is there a way in the Unity configuration file that one can specify a path (sort of like probing) where the DLLs might live - or to put the path inside the mappings themselves somehow? I don't want to actually have to modify the probing paths in the machine.config etc. if we can avoid that.
I've looked on MSDN and Googled around but couldn't find anything of help.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我也怀疑这是Unity的问题。您是否尝试过使用 Fusion 日志查看器 FUSLOGVW.EXE 来查看应用程序尝试加载的内容以及在何处查找程序集?
http://www.ademiller.com/blogs/tech/2008/01/gotchas-fusion-log-viewer-your-best-friend-for- assembly-load-errors/
这应该告诉您当前的探测路径是什么样子,您可以从那里开始。
I too doubt this is a Unity issue. Have you tried using the Fusion log viewer, FUSLOGVW.EXE, to see what the application is trying to load and where it's looking for the assemblies?
http://www.ademiller.com/blogs/tech/2008/01/gotchas-fusion-log-viewer-your-best-friend-for-assembly-load-errors/
This should tell you what the current probing path looks like and you can take it from there.
这最终不是 Unity 问题 - 更重要的是我试图在 IIS 中托管应用程序并且必须正确配置它。
This wasn't a Unity issue in the end - it was more that I was trying to host the application within IIS and had to configure that correctly.