Some quick notes on the basics. I’ll try to follow this up with another post soon on some of the particulars.
Creating a new configuration:
- Build -> Configuration Manager
- In the drop down of current configurations, go all the way to the bottom and select “Add new…”
- You can choose to copy settings from an existing configuration (such as debug or release)
- If you are on the solution configuration drop down, there is a box to create a matching configuration for ALL of your projects
- If you are on a project configuration drop down, there is a box to create a matching configuration for the solution
Creating a new web.config transform file for the new configuration
Once you have created a new configuration you can set up specific web config rules for it.
- Right click the web config file in the project
- Select “Add Config Transforms”
- This will add a new config transform named web.[my-configuration-name-here].config that is grouped underneath web.config in the solution explorer.
- You can now use this to add some “transforms” to the web config for that specific build configuration, such as turning off debug params or changing the db connection string
Setting package/publish options
- Right click the web application project
- Select “Package/Publish Settings”
- Alternatively, you can get to it by selecting project properties and then the “Package/Publish Web” tab
- Change settings as appropriate
- Note: there is also a tab for package/publish SQL options if you want it to handle DB stuff as well
Building a deployment package
- Right click the project
- Select Build Deployment package
- The default location for this to build to is /[my-project-name]/obj/[my-configuration-name/Package