Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
556 views
in Technique[技术] by (71.8m points)

visual studio 2012 - how to add files in web.config transformation process?

I am having a website developed in Visual Studio 2012. The web.config is currently containing following files in its transformation: - web.Debug.config - web.Release.config

I have recently added a new build configuration (named as "Staging") in my project. How can I create a "web.Staging.config" transformation file?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

There are two ways for the web.config transform files to be generated within VS:

  1. If you have a web application project, Right-click on web.config and choose Add Config Transform. This will add any config transforms that are missing from your project based on build configurations (i.e. if you have Production and Staging build configs, both will get a transform added).
    • This method is not supported for Website projects as they do not support multiple build configurations.
  2. In either web project type, right click on a publish profile (.pubxml) and choose Add Config Transform. This will add a new config transform for that profile only.
    • This requires VS2012 Update 2 or the Azure SDK 2.0 for VS2010 (I think).
    • In a web site project, the new transform file will not be nested under web.config as VS doesn't support that behavior. Just look for it in the root folder.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...