I added the following code to my .csproj to minimize the JS files that were changed when the project was created:
<Target Name="BeforeBuild"> <MSBuild Targets="CheckAndMinifyJS" Projects="$(MSBuildProjectFile)" /> </Target> <ItemGroup> <JS Include="$(ProjectDir)\**\*.js" /> </ItemGroup> <Target Name="CheckAndMinifyJS" Inputs="@(JS)" Outputs="@(JS->'$(ProjectDir)%(RecursiveDir)%(Filename).min.js')"> <AjaxMin JsSourceFiles="@(JS)" JsSourceExtensionPattern="\.js$" JsTargetExtension=".min.js" /> </Target> <UsingTask TaskName="AjaxMin" AssemblyFile="..\..\ThirdParty\AjaxMinTask.dll" />
This works fine, but it has a side effect: when you look at a project in Visual Studio (2015), all JS files look duplicated (the same path, but different assembly steps):

I would like to avoid having an element with the JS build action appearing in the project. How can i do this?
Please note that several developers work with the project, so any proposed solution should be contained inside a .csproj or solution (for example: it is unacceptable to ask all developers to change their registry in order to change the default action for the assembly for JS files).
source share