从程序集中复制 DLL 以进行部署
NET 在我的本地计算机上我有一个对本地程序集文件夹上的 DLL 的引用。 我想知道如何在部署我的网站时“打包”这个 dll? 当我在临时服务器上部署时,它开始抱怨它没有该 dll。 (它不在登台服务器的 GAC 中)。 谢谢。
NET on my local machine I have a reference to a DLL on my local assembly folder. I was wondering how I can "package" this dll with the deployment of my website? When I deploy on the staging server it starts complaining that it does not have that dll. (It is not in the GAC of the staging server). Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您引用的 DLL 不在目标计算机的 GAC 中,那么您应该将该 DLL 放置在网站的
\bin
文件夹中。 对于 asp.net 网站,引用的 DLL 必须存在于 GAC 或\bin
文件夹中。 或者,您可以使用 WebSetup 项目之类的工具将 DLL 安装到目标计算机的 GAC 中。If your referenced DLL will not be in the GAC of the targeted computer then you should place the DLL in your web site's
\bin
folder. For asp.net websites, referenced DLLs must exist in the GAC or in the\bin
folder. Alternatively, you could install your DLL into the GAC of your target computer using something like a WebSetup project.您是否尝试过将 DLL 引用设置为 CopyLocal = true?
Have you tried setting the DLL reference to CopyLocal = true?
Visual Studio 将参考位置保存为相对路径,因此将其放入项目中的文件夹中,并确保其属性“复制本地”为 true,这将使 VS 将文件复制到输出目录。
Visual Studio Save the Reference Location as relative paths so put in the a folder in your project and make sure the it proprieties "Copy Local" is true, it will make the VS to copy the file to the output directory.