1
2
If you can endure the excruciating pains of MSBuild's copy statement, then you can do something like this as a post-build event:
现在让我们来看看。 $(env)是环境。您必须通过构建脚本传递它。 SourceFiles is set to the config file's original name (Web.MyFavoriteEnvironment.config, for example). DestinationFiles is set to the same thing, only shortened to Web.config, overwriting whatever Web.config was there before. This is what your app will use. 将此消息传递到应用程序配置文件命名约定中。 现在。。。 Although (something like) this works for my team, I really hope, for your sake, that someone posts something better. |