I'm posting this question because I've just spent 1 complete day searching for the answer that I didn't find anywhere.
The problem is that I have 3 environments for my application :
So I have created a web config for each environment in order to change the database source. And I have also created a deploy profile for each environment in order to specify their respective server.
To test if my differents web config work as expected, I tried to swap every database source/server : dev server with qua database, dev server with prod database and so on...
But, for each deploy, the server keep the related database source :
However, I followed every doc I found and tried a lot of alternatives from https://learn.microsoft.com/en-us/previous-versions/aspnet/dd465326(v=vs.110)?redirectedfrom=MSDN, using SetAttributes, Replace, Remove/Insert... but nothing resolved my problem.
Don't name your profiles like their web.config. Visual Studio seems to apply the web.config with the same name as the profile after the web.config you specified and overrides it.