I am using Visual Studio 2019 and am upgrading a .vbproj file to use some more modern features - I think the initial solution/project may have been built as far back as VS 2008. I'm converting the masses of explicit file includes into one wildcard to pull in all my files:
<ItemGroup>
<Compile Include="Src\**\*.vb" />
</ItemGroup>
This works great, I can see all the files inside Visual Studio's project explorer. However, when I build the project, this wildcard gets expanded out and every source file is named, like this:
<ItemGroup>
<Compile Include="Src\Code\File1.vb" />
<Compile Include="Src\Code\File2.vb" />
<Compile Include="Src\Code2\File1.vb" />
</ItemGroup>
This doesn't happen until I build the project, I can load Visual Studio with no issues and the project file remains untouched.
I'm doing this because of having a few problems merging these files across some refactoring branches where many files are deleted, so this method would be much easier.
Can I prevent Visual Studio from doing this?