MVC3 引用 GAC 中安装的 dll
我安装了一些旧版 dll,作为 asp.net MSI 安装包的一部分。所有 dll 都安装到 GAC 中。在 asp.net 上,我能够通过将此类条目放入 web.config 文件来引用 GAC 中的 dll,
<add assembly="MY.DEPENDENCY.MODULE, Version=1.2.3, Culture=neutral, PublicKeyToken=qwertyuiop"/>
我在 MVC3 中执行了与上面相同的操作,但我的消息来源抱怨它找不到预期的引用。有其他人知道或以前做过吗?
谢谢
I have some legacy dlls installed as part of a asp.net MSI setup package. All dlls are installed into the GAC. On asp.net I was able to reference dlls in GAC by placing such entries into the web.config file
<add assembly="MY.DEPENDENCY.MODULE, Version=1.2.3, Culture=neutral, PublicKeyToken=qwertyuiop"/>
I did the same thing as above in MVC3 but my source complains it can't find the expected references. have anyone else know or done this before?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否尝试从 VS 内部添加引用?右键单击“引用”>“添加引用”
Did you try adding a reference from inside VS? Right click on References>Add Reference
当您通过添加引用引用 dll 时,您可以在发布时通过单击引用的 dll 并将属性中的“复制本地”选项更改为 true 来推送该 dll。然后在部署时使用项目的发布功能。
当您发布时,这不会硬编码路径,它只是使用该路径进行编译。
然后,发布的应用程序将查看该 dll 的 bin 文件夹。
When you reference a dll via the Add Reference, you can have it push when you publish by clicking on the referenced dll and change the "Copy Local" option in properties to true. Then when you deploy use the publish function of the project.
This doesn't hard code a path when you publish, it just uses that path to do the compilation.
The published app will then look at the bin folder for that dll.