如何获取 Visual Studio 的“发布网站” 1. 不覆盖 web.config & 2. 提升从我的 GAC 引用的 dll 副本

发布于 2024-07-09 19:17:48 字数 141 浏览 6 评论 0原文

我开始使用在开发过程中从 GAC 引用的库。 当我将其提升到网络服务器时,我希望将 dll 包含在项目 bin 目录中。 我还需要我的本地和服务器 web.config 不同。 在开始使用这个库之前,我非常喜欢使用 VS 的发布网站功能。 现在它似乎成了障碍。

I started using a a library which I reference from the GAC during development. I want the dll included in the project bin directory when I promote it to the webserver. I also need my local and the server web.config to be different. Before I started using this library I really enjoyed using the publish website feature of VS. Now it just seems to be getting in the way.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(4

ぽ尐不点ル 2024-07-16 19:17:48

关于 web.config 部署问题:Scott Guthrie 在这里写道:

提示/技巧:使用 VS 2005 自动化开发、QA、暂存和生产 Web.Config 设置

您可以在 Visual Studio 构建环境中轻松地自动化配置过程(并且以在 IDE 中以及命令行/自动构建中都有效的方式执行此操作)

Regarding the web.config deployment problem: Scott Guthrie wrote about here:

Tip/Trick: Automating Dev, QA, Staging, and Production Web.Config Settings with VS 2005

You can easily automate the configuration process within the Visual Studio build environment (and do so in a way that works both within the IDE, as well as with command-line/automated builds).

百变从容 2024-07-16 19:17:48

当前使用发布工具的配置会将 web.config 发送到最终站点,据我所知,没有办法解决这个问题。

Visual Studio 2010 将提供有针对性的配置的能力,允许部署过程推出不同的配置。

至于 .dll 引用,我相信使其正常工作的唯一方法是在引用上将“Copy Local”设置为 true。

Current configuration with the publish tool will send the web.config to the final site, and as far as I know there is no way around this.

Visual Studio 2010 is going to offer the ability to have targeted configurations allowing the deployment process to push out a different configuration.

As for the .dll reference, I believe the only way to get that to work is if you have "Copy Local" set to true on the reference.

病女 2024-07-16 19:17:48

这并不理想 - splattne 的答案是设置的正确方法 - 但您可以将其从项目文件中移出(“从项目中排除”)并将其保留在您的解决方案中(VS2010 中的“解决方案项目”)。

这是您发布时不会被复制的。

It's not ideal - splattne's answer is the correct way to set things up - but you can move it out of you project file ('Exclude From Project') and just keep it in your solution ('Solution Items' in VS2010).

This was it won't be copied when you publish.

£冰雨忧蓝° 2024-07-16 19:17:48

我发现使用 Visual Studio 2010 发布时,在目标服务器上将生产 Web.Config 设为只读效果很好。

希望这会有所帮助。

I found that making production Web.Config readonly on target server works fine when Publishing with Visual Studio 2010.

Hope this helps.

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