Try to do the following steps:
Step I.
- Right click on a web project name in a solution explorer and choose "Publish"
- Inside a "Pick a publish target" select "Folder"
- Make sure you have "bin\Release\" in a "Folder or File Share" right pan
- Click on "Create Profile" button in a bottom right corner of the popup
- In opened window click on "Rename Profile" blue link
- Set "Release" in a "New Profile Name" input box
Step II.
- Once again right click on a web project name in a solution explorer and choose "Publish"
- Click on "Create new profile" blue link
- Inside a "Pick a publish target" select "Folder"
- Make sure you have "bin\Debug\" in a "Folder or File Share" right pan
- Click on "Create Profile" button in a bottom right corner of the popup
- In opened window click on "Settings" blue link
- In an opened "Publish" popup inside a left menu choose "Settings"
- Set "Debug" in a "Configuration" drop down list
- Click on "Save" button
- Click on "Rename Profile" blue link
- Set "Debug" in a "New Profile Name" input box
- Click on "Save" button
As a result you will have 2 profiles for publishing that you can specify in a drop down list before publishing.
You can also create as many profiles as you need.
Final Step.
Try to play with it consistently changing profiles, then clicking on a "Publish" button and checking your specified output folders:
If you make everything correctly you will have specific Web.config files inside each folder.