I'm trying to auto-detect web.configs as part of a transform pre-build event in one of my web application project files, this code goes up one folder level from my project file and gets all web.configs in every directory and sub directory:
<ItemGroup>
<WebConfigsRelativePath Include ="..\**\Web.config"/>
</ItemGroup>
This works great but everytime I build and exit Visual Studio, I get a prompt asking me if I want to save changes made to my solution file. If I select yes, and open the project file, the above code is changed to the locations of each web.config
<ItemGroup>
<WebConfigsRelativePath Include="..\Web\Decade\Web.config" />
<WebConfigsRelativePath Include="..\Web\Matrix\RiskAnalysis\Web.config" />
<WebConfigsRelativePath Include="..\Web\Service\Web.config" />
<WebConfigsRelativePath Include="..\Web\Web.config" />
</ItemGroup>
This would be fine but the whole reason I'm auto-detecting web.configs pre-build is so I can add and remove web.configs as I please without having to hardcode their locations, and everytime I exit VS, the locations will be hardcoded in the project file....
Does anyone know why this ItemGroup changes every time I exit Visual Studio?