I'd like to create a targets file that is compatible with C# and VB projects, unfortunately it needs knowledge of the project language.
I could just make one file for each language, but it would be cleaner if I could just use one file, and have a condition that checks which language we need.
Is there a way of doing this?
I was hoping for something like this:
<Target Name="BeforeBuild" Condition="'$(Language)"' == 'C#'">
or
<Target Name="BeforeBuild" Condition="'$(ProjectFile).Extension' == 'csproj'">
I've tried searching, but there is a lot of noise for these search terms. I've tried many variations on the following terms with no luck.
- msbuild project check language
- msbuild project condition if vb or c#
- csproj check language
If we get a good answer, hopefully the next person will find this a lot easier to find an answer for.