如何使用 ApplicationManager 加载对象而不需要 GAC 处理它?
我正在尝试使用 Cassini Web 服务器创建部署测试主机 - 一种嵌入式 Web 服务器,用于将 Web 服务器配置问题与应用程序部署问题隔离。好的,所以这行代码会爆炸,直到我将 Cassini 放入 GAC 中:
// physical path points to the bin folder with the dll
_host = (Host)_appManager.CreateObject(appId, typeof(Host),
_virtualPath, _physicalPath,
false /*failIfExists*/);
上面的代码因 FileNotFoundException 失败 - 就好像它试图找到 Cassini.dll
我应该能够告诉 ApplicationManager 在哪里查找而不采取将其放入 GAC 的极端步骤?
我使用的是 Cassini 2.1,源代码在这里。
I'm trying to use the Cassini webserver to create a deployment test host- a sort of embedded web server to isolate web server config issues from app deployment issues. Okay, so this line of code blows up until I put Cassini in the GAC:
// physical path points to the bin folder with the dll
_host = (Host)_appManager.CreateObject(appId, typeof(Host),
_virtualPath, _physicalPath,
false /*failIfExists*/);
The above fails with FileNotFoundException -- as if it is trying to find the Cassini.dll
Should I just be able to tell ApplicationManager where to look without taking the extreme step of putting it into the GAC?
I am using Cassini 2.1 and the source code is here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信我也遇到过类似的问题,我需要做的就是将搜索到的 DLL 放入 bin 子目录中。
如果搜索到的 DLL 位于当前目录中,则创建一个名为“bin”的连接点来引用当前目录就足够了。
I believe I had a similar problem and what I needed to do was put the searched-for DLLs into a bin subdirectory.
If the searched-for DLLs are located in the current directory, it's enough to create a junction point called "bin" that refers to the current directory.