I've created my own targets file which during the build process runs a custom tool generates some C# code which are then included in the .csproj.
I have something very like this.
<Project Sdk="Microsoft.NET.Sdk" InitialTargets="MyTarget">
.....
<Import Project="MyTargetsFile.targets" />
<ItemGroup>
<XYZ Include="**\*.xyz" />
</ItemGroup>
</Project>
The problem I encounter if that if I change the .xyz visual studio does trigger a rebuild because it considers it up to date. On the other hand if i run msbuild Systems.csproj /v:diag > Build.log
it detects the changes and it rebuilds the project.
After a bit more research I've reached the conclusion that VS doesn't not even trigger MSBuild in this case. Is seems to me that visual studio just checks just .cs
files for changes and ignores the rest.
Now my question is how do I make VS trigger msbuild if I've made a change in my .xyz
file?
I'm using Visual Studio Enterprise 2017 Version 15.6.6
Update
I know I can set the build action for the files to Compile
but they contain .xml and that causes an error.
I also know that I can clean the project and build, but I'm interested in an incremental build not a full one.