Inside .csproj files Visual Studio and Xamarin Studio as default keep a reference to every file used inside the project.
<ItemGroup>
<Compile Include="Utils\Foo1Utils.cs" />
<Compile Include="Utils\Foo2Utils.cs" />
<Compile Include="Services\FooService.cs" />
...
</ItemGroup>
To avoid conflicts on csproj files inside our solution at every file addition, we started to use wildcards:
<ItemGroup>
<Compile Include="Utils\*.cs" />
<Compile Include="Services\*.cs" />
...
</ItemGroup>
The problem is that apparently both on Visual Studio and Xamarin Studio is not possible to "explain" to the IDE that we are using wildcards, and when we add a new file to the project they add a new reference to the file ignoring the wildcard *.cs
on the folder. It's still a good solution because we don't need to commit our .csproj at every file addition, but now we have to reset them each time... anyone knows if there is a solution?
EDIT: with Rider (JetBrains) there isn't this problem, if in the csproj there is a wildcard and I add a new file everything works fine.
If you use the new format for projects (.net core 2) it will use wildcard includes without you having to specify it for files in the project folder. You can manually set the target framework in order to still compile to whatever target you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With