Use MVC 2.1 at design time for Razor 3.0 projects. (dotnet/aspnetcore-tooling#4324)
- When we detect a design time build we force tooling to use 2.1
- In runtime builds (i.e. rzc) it still uses the 3.0 configuration for 3.0 apps.
(cherry picked from commit dotnet/aspnetcore-tooling@0326abe530)
\n\nCommit migrated from a6dc88e455
This commit is contained in:
parent
5bb16b1a14
commit
c8bb6c34bb
|
|
@ -50,6 +50,12 @@ Copyright (c) .NET Foundation. All rights reserved.
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(RazorLangVersion)'==''">
|
<PropertyGroup Condition="'$(RazorLangVersion)'==''">
|
||||||
<RazorLangVersion Condition="'$(_TargetingNETCoreApp30OrLater)' == 'true'">3.0</RazorLangVersion>
|
<RazorLangVersion Condition="'$(_TargetingNETCoreApp30OrLater)' == 'true'">3.0</RazorLangVersion>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
For dev16 the Razor toolings bits don't currently understand 3.0 projects. Therefore, we default to 2.1 which is currently
|
||||||
|
functionally equivalent. This will be undone in the near future.
|
||||||
|
-->
|
||||||
|
<RazorLangVersion Condition="'$(_TargetingNETCoreApp30OrLater)' == 'true' AND '$(DesignTimeBuild)' == 'true'">2.1</RazorLangVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|
@ -57,6 +63,12 @@ Copyright (c) .NET Foundation. All rights reserved.
|
||||||
-->
|
-->
|
||||||
<PropertyGroup Condition="'$(RazorDefaultConfiguration)'==''">
|
<PropertyGroup Condition="'$(RazorDefaultConfiguration)'==''">
|
||||||
<RazorDefaultConfiguration Condition="'$(_TargetingNETCoreApp30OrLater)' == 'true'">MVC-3.0</RazorDefaultConfiguration>
|
<RazorDefaultConfiguration Condition="'$(_TargetingNETCoreApp30OrLater)' == 'true'">MVC-3.0</RazorDefaultConfiguration>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
For dev16 the Razor toolings bits don't currently understand 3.0 projects. Therefore, we default to 2.1 which is currently
|
||||||
|
functionally equivalent. This will be undone in the near future.
|
||||||
|
-->
|
||||||
|
<RazorDefaultConfiguration Condition="'$(_TargetingNETCoreApp30OrLater)' == 'true' AND '$(DesignTimeBuild)' == 'true'">MVC-2.1</RazorDefaultConfiguration>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
@ -65,16 +77,33 @@ Copyright (c) .NET Foundation. All rights reserved.
|
||||||
it here. The IDE is hardcoded to inject 2.0 support when needed. The settings flowing through MSBuild should reflect
|
it here. The IDE is hardcoded to inject 2.0 support when needed. The settings flowing through MSBuild should reflect
|
||||||
the project's runtime.
|
the project's runtime.
|
||||||
-->
|
-->
|
||||||
<RazorConfiguration Include="MVC-3.0">
|
<RazorConfiguration Include="MVC-3.0" Condition="'$(DesignTimeBuild)' != 'true'">
|
||||||
<Extensions>MVC-3.0;$(CustomRazorExtension)</Extensions>
|
<Extensions>MVC-3.0;$(CustomRazorExtension)</Extensions>
|
||||||
</RazorConfiguration>
|
</RazorConfiguration>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
For dev16 the Razor toolings bits don't currently understand 3.0 projects. Therefore, we default to 2.1 which is currently
|
||||||
|
functionally equivalent. This will be undone in the near future.
|
||||||
|
-->
|
||||||
|
<RazorConfiguration Include="MVC-2.1" Condition="'$(DesignTimeBuild)' == 'true'">
|
||||||
|
<Extensions>MVC-2.1;$(CustomRazorExtension)</Extensions>
|
||||||
|
</RazorConfiguration>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<RazorExtension Include="MVC-3.0">
|
<RazorExtension Include="MVC-3.0" Condition="'$(DesignTimeBuild)' != 'true'">
|
||||||
<AssemblyName>Microsoft.AspNetCore.Mvc.Razor.Extensions</AssemblyName>
|
<AssemblyName>Microsoft.AspNetCore.Mvc.Razor.Extensions</AssemblyName>
|
||||||
<AssemblyFilePath>$(RazorSdkDirectoryRoot)extensions\mvc-3-0\Microsoft.AspNetCore.Mvc.Razor.Extensions.dll</AssemblyFilePath>
|
<AssemblyFilePath>$(RazorSdkDirectoryRoot)extensions\mvc-3-0\Microsoft.AspNetCore.Mvc.Razor.Extensions.dll</AssemblyFilePath>
|
||||||
</RazorExtension>
|
</RazorExtension>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
For dev16 the Razor toolings bits don't currently understand 3.0 projects. Therefore, we default to 2.1 which is currently
|
||||||
|
functionally equivalent. This will be undone in the near future.
|
||||||
|
-->
|
||||||
|
<RazorExtension Include="MVC-2.1" Condition="'$(DesignTimeBuild)' == 'true'">
|
||||||
|
<AssemblyName>Microsoft.AspNetCore.Mvc.Razor.Extensions</AssemblyName>
|
||||||
|
<AssemblyFilePath>$(RazorSdkDirectoryRoot)extensions\mvc-2-1\Microsoft.AspNetCore.Mvc.Razor.Extensions.dll</AssemblyFilePath>
|
||||||
|
</RazorExtension>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(GenerateRazorAssemblyInfo)'=='true' AND '$(ResolvedRazorCompileToolset)'=='RazorSdk' AND ('$(RazorCompileOnBuild)' == 'true' OR '$(RazorCompileOnPublish)' == 'true')">
|
<ItemGroup Condition="'$(GenerateRazorAssemblyInfo)'=='true' AND '$(ResolvedRazorCompileToolset)'=='RazorSdk' AND ('$(RazorCompileOnBuild)' == 'true' OR '$(RazorCompileOnPublish)' == 'true')">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue