开发者

Publishing using different Web.config

开发者 https://www.devze.com 2023-03-29 15:37 出处:网络
I have a Visual Studio 2010 web-application solution I have created. In this solution I have created a new mode in the configuration manager called \"MyProjectName\". I have created an additional tran

I have a Visual Studio 2010 web-application solution I have created. In this solution I have created a new mode in the configuration manager called "MyProjectName". I have created an additional transform (I think you call it). i.e. Web.MyProjectName.config.

When I choose the publish option on the project, I have the "MyProjectName" option selected from the build mode.

However, the Web.MyP开发者_如何学编程rojectName.config is not copied to the published folder.

How do I get different Web.config's published depending on what configuration mode I have selected?

Thanks in advance.


You will need to copy your new config file using either of the two options:

  • modify your project file to add a Target Named "BeforeBuild" (or modify if it exists)
  • add a "Pre Build" event

(I prefer the first one)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号