Fix issues with adding desktop reference.

* Add the reference only if precompilation is enabled.
* Make the reference Private. We don't want it to be copied locally to the output
This commit is contained in:
Pranav K 2017-06-20 18:24:42 -07:00
Родитель 9b89aca3c3
Коммит 5834660081
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -58,7 +58,7 @@
<Target
Name="_AddDesktopReferences"
AfterTargets="ResolveLockFileReferences"
Condition="'$(_MvcViewCompilationAddDesktopReferences)'!='false' AND '$(TargetFrameworkIdentifier)'=='.NETFramework'">
Condition="'$(MvcRazorCompileOnPublish)'=='true' AND '$(_MvcViewCompilationAddDesktopReferences)'!='false' AND '$(TargetFrameworkIdentifier)'=='.NETFramework'">
<PropertyGroup Condition="'$(_MvcViewCompilationBinaryPath)'==''">
<_MvcViewCompilationBinaryPath Condition="'$(PlatformTarget)'=='x64'">$(MSBuildThisFileDirectory)$(MSBuildThisFileName)-x64.exe</_MvcViewCompilationBinaryPath>
@ -66,7 +66,7 @@
</PropertyGroup>
<ItemGroup Condition="'$(_MvcViewCompilationBinaryPath)'!=''">
<Reference Include="$(_MvcViewCompilationBinaryPath)" Private="true" />
<Reference Include="$(_MvcViewCompilationBinaryPath)" Private="false" Visible="false" />
</ItemGroup>
</Target>