从程序集中复制 DLL 以进行部署

发布于 2024-07-14 17:09:07 字数 125 浏览 3 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

冷清清 2024-07-21 17:09:07

如果您引用的 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.

篱下浅笙歌 2024-07-21 17:09:07

您是否尝试过将 DLL 引用设置为 CopyLocal = true?

Have you tried setting the DLL reference to CopyLocal = true?

梨涡 2024-07-21 17:09:07

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文