After deploying to Azure, I kept getting server errors — the application would not run. So I did a remote desktop into the instance and found that the web.config was completely overhauled…what’s going on? I thought web.config was packaged as-is? Instead, the entire configuration has been replaced. When I replace the “new” version with the original, unaltered, correct configuration, my app works as intended.
First off, what’s going on here? What am I doing wrong? This way I can understand and not replicate this in the future.
Secondly, how do I stop this behavior? I want the original web.config deployed — not some arbitrary imposter. Thank you!
Based on dunnry’s suggestion to unzip the cskpkg file, I noticed that the web.config was never even packaged — so Azure must have been creating a basic one out of necessity (without warning me!?!?). After some investigation, I came across this nugget (from another StackOverflow question addressing deployment issues):
After changing BuildAction back to “Content” my deployment now works as expected.