I have a web site I just took over and am wanting to get web transformations working. I have always had success with MVC projects doing this for debug and release but this ASP web pages application refuses to cooperate.
I apologize if this is a duplicate. I see a lot of questions like this but nothing has solved my issue yet.
If I press F5 and run, I get web.config settings as I expect. If I publish my "Test" profile (debug mode) I get web.Test.Config transformations as expected. If I publish my "Release" profile I get the same web.Test.Config transformations and NOT the release one.
Possible issues or things that may be of interest:
The web.config file expands in the solution to show the debug file. The release file is not part of this and is listed separately below.
I tried changing the compilation setting for debug to false in the main web.config. This had no effect.
In the SLN file I noticed that I have lines in the GlobalSection for postSolution that list my project GUID followed by .Debug or .Release. BOTH of these say "Debug|Any CPU" at the end. I changed the release ones to say "Release|Any CPU". I republished but VS just changed this back to Debug on me.
In Build -> Configuration Manager, I select Release as thje Active soltion configuration. In the Project contexts box, my application only has Debug available in the Configuration column drop down.
Edit: I noticed that in website.publishproj there was no section for Release. There was a PropertyGroup with configuration of Debug but that's all. Being cavalier or stupid I ignored the "do not modify this file" message and added the release section. This had no effect.
Edit: Photo pasted in. The dropdown is expanded. <a href="https://i.stack.imgur.com/9K1Pz.png" rel="nofollow"><img alt="Build configuration screen" class="b-lazy" data-src="https://i.stack.imgur.com/9K1Pz.png" data-original="https://i.stack.imgur.com/9K1Pz.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" /></a>Answer1:
The highlighted dropdown is where you would need to add the configuration back in:
<a href="https://i.stack.imgur.com/EhfXD.png" rel="nofollow"><img alt="enter image description here" class="b-lazy" data-src="https://i.stack.imgur.com/EhfXD.png" data-original="https://i.stack.imgur.com/EhfXD.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" /></a>