-->

Call Visual Studio 2017 Task Runner from MSBuild?

2019-07-27 01:11发布

问题:

I am using the Bundler & Minifier VS2017 extension for JavaScript and CSS minification and MSBuild for other components of my ASP.NET 4.0 Web Forms solution. Using Task Runner, I created an "After Build" binding so the minification happens after MSBuild. This extension updates the bundle in real time when source file changes are saved so I would like the extension to do its work only when a Release build is created.

I suppose there is no way to configure the binding so it only activates for a Release build so instead, is it possible to call Task Runner from MSBuild? Maybe something like:

<Exec Condition="'$(Configuration)' == 'Release'" Command="<Task Runner Command Here>" />

Also, besides the Visual Studio Marketplace page for the previous release and this blog page, is there any real documentation for the Task Runner that is included in VS2017?

UPDATE: I found this CLI WIKI & this article but when I install NuGet pkg I get "Could not install package 'BundlerMinifier.Core 2.0.238'. You are trying to install this pkg into a project that targets .NETFramework,Ver=v4.0" This approach not viable for a 4.0 target Web Forms solution? Not sure why it matters since minify happens at build time and not runtime.