Don't invoke GetDotNetHost task from desktop msbuild. (#163)

* Don't invoke GetDotNetHost task from desktop msbuild.

Fixes https://github.com/aspnet/MvcPrecompilation/issues/161
This commit is contained in:
Pranav K 2017-07-06 15:03:38 -07:00 committed by GitHub
parent 36bdecf56f
commit 73b5e2fd70
1 changed files with 6 additions and 1 deletions

View File

@ -38,11 +38,16 @@
DependsOnTargets="_CreateResponseFileForMvcRazorPrecompile" DependsOnTargets="_CreateResponseFileForMvcRazorPrecompile"
Condition="'$(TargetFrameworkIdentifier)'=='.NETCoreApp'"> Condition="'$(TargetFrameworkIdentifier)'=='.NETCoreApp'">
<GetDotNetHost Condition="'$(MvcRazorRunCommand)'==''"> <!--
GetDotNetHost attempts to locate the muxer path if the executing process is a .NET Core application i.e. dotnet msbuild.
If we know we're being launched from desktop MSBuild, avoid running the task. We'll use the dotnet that appears in the path.
-->
<GetDotNetHost Condition="'$(MSBuildRuntimeType)'=='Core' AND '$(MvcRazorRunCommand)'==''">
<Output TaskParameter="MuxerPath" PropertyName="MvcRazorRunCommand" /> <Output TaskParameter="MuxerPath" PropertyName="MvcRazorRunCommand" />
</GetDotNetHost> </GetDotNetHost>
<PropertyGroup> <PropertyGroup>
<MvcRazorRunCommand Condition="'$(MvcRazorRunCommand)'==''">dotnet</MvcRazorRunCommand>
<_MvcViewCompilationBinaryPath Condition="'$(_MvcViewCompilationBinaryPath)'==''">$(MSBuildThisFileDirectory)$(MSBuildThisFileName).dll</_MvcViewCompilationBinaryPath> <_MvcViewCompilationBinaryPath Condition="'$(_MvcViewCompilationBinaryPath)'==''">$(MSBuildThisFileDirectory)$(MSBuildThisFileName).dll</_MvcViewCompilationBinaryPath>
<ExecArgs>&quot;$(MvcRazorRunCommand)&quot; exec</ExecArgs> <ExecArgs>&quot;$(MvcRazorRunCommand)&quot; exec</ExecArgs>