Spring配置文件编辑后强制重建

发布于 2024-10-09 20:56:47 字数 241 浏览 0 评论 0原文

在我们的 C# 项目中,我们使用 Spring 作为控制反转 (IoC) 容器。我们注意到,对 Spring 配置 xml 文件的更改不会导致解决方案被重建。因此,更改后的配置不会复制到输出文件夹,并且每次调试运行都使用旧配置。

即使项目代码没有更改,我们如何强制 Visual Studio (2008) 复制配置文件?

更多信息: 配置文件的构建操作设置为。 “复制到输出目录”设置为始终复制

In our C# project we use Spring as an Inversion of Control (IoC) container. We noticed, that changes to the Spring configuration xml file do not cause the solution to be rebuild. Therefore the changed configuration is not copied to the output folder and every debug-run uses the old configuration.

How can we force Visual Studio (2008) to copy the config file even though none of the project code has changed?

Further info:
The build action of the config file is set to None. Copy to Output Directory is set to Copy always.

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

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

发布评论

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

评论(1

倥絔 2024-10-16 20:56:47

看来解决方案比我想象的要简单。如果 *.xml 配置文件的构建操作更改为嵌入资源,则更改文件也会影响项目。因此,每个调试周期都会导致项目重建,其中包含配置文件。这会导致文件被复制到具有调整后的配置的输出目录。 =>问题解决了。

Seems the solution is simpler than I thought. If the build action for the *.xml config file is changed to Embedded Resource, then changing the file also touches the project. Therefore, every debug cycle causes a rebuild of the project, where the config file is included. This causes the file to be copied to the output directory with the adjusted configuration. => Problem solved.

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