Skip to content

Commit 0a42cca

Browse files
authored
Razor SDK build ordering issues (#22684)
* Razor SDK build ordering issues * Build the SDK completely regardless of the MSBuild runtime type * Split SDK integration tests into a separate project. Clean up project file * Add project to sln * Update Microsoft.NET.Sdk.Razor.csproj * Fixup tests * Avoid rebuilding dependencies if they appear up to date. Fixup tests * Fixup * Update CSharp.Common.props * Cleanup the build
1 parent 5d99620 commit 0a42cca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+174
-143
lines changed

eng/targets/CSharp.Common.props

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@
2222
several versions older than latest. We reference the project to ensure it's built before the other projects that use it. Since this
2323
is a project reference, we must explicitly import the props file and also specify the output location of the SDK directory.
2424
-->
25-
<ProjectReference Include="$(RepoRoot)src\Razor\Microsoft.NET.Sdk.Razor\src\Microsoft.NET.Sdk.Razor.csproj" PrivateAssets="All" IsImplicitlyDefined="true" ReferenceOutputAssembly="false" >
26-
<!-- Use the same logic as Sdk.Razor.CurrentVersion.Targets -->
27-
<SetTargetFramework Condition=" '$(MSBuildRuntimeType)' == 'Core'">TargetFramework=$(DefaultNetCoreTargetFramework)</SetTargetFramework>
28-
<SetTargetFramework Condition=" '$(MSBuildRuntimeType)' != 'Core'">TargetFramework=net46</SetTargetFramework>
29-
</ProjectReference>
25+
<ProjectReference Include="$(RepoRoot)src\Razor\Microsoft.NET.Sdk.Razor\src\Microsoft.NET.Sdk.Razor.csproj"
26+
PrivateAssets="All"
27+
IsImplicitlyDefined="true"
28+
ReferenceOutputAssembly="false"
29+
SkipGetTargetFrameworkProperties="true"
30+
UndefineProperties="TargetFramework;TargetFrameworks" />
3031
</ItemGroup>
3132

3233
<PropertyGroup>

src/Components/Web.JS/dist/Release/blazor.server.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Razor/Microsoft.AspNetCore.Razor.Tools/src/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
using System.Runtime.CompilerServices;
55

66
[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Razor.Tools.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
7-
[assembly: InternalsVisibleTo("Microsoft.NET.Sdk.Razor.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
7+
[assembly: InternalsVisibleTo("Microsoft.NET.Sdk.Razor.IntegrationTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
88
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]
99

src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildIntegrationTest.cs renamed to src/Razor/Microsoft.NET.Sdk.Razor/integrationtests/BuildIntegrationTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using System.Linq;
77
using System.Runtime.InteropServices;
88
using System.Threading.Tasks;
9-
using Microsoft.AspNetCore.Razor.Language;
109
using Microsoft.AspNetCore.Testing;
1110
using Microsoft.Extensions.DependencyModel;
1211
using Xunit;
@@ -632,7 +631,7 @@ public async Task Build_WithoutServer_ErrorDuringBuild_DisplaysErrorInMsBuildOut
632631
Assert.BuildFailed(result);
633632
Assert.BuildOutputContainsLine(
634633
result,
635-
$"Invalid option 5.0 for Razor language version --version; must be Latest or a valid version in range {RazorLanguageVersion.Version_1_0} to {RazorLanguageVersion.Latest}.");
634+
$"Invalid option 5.0 for Razor language version --version; must be Latest or a valid version in range 1.0 to 3.0.");
636635

637636
// Compilation failed without creating the views assembly
638637
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.dll");

src/Razor/Microsoft.NET.Sdk.Razor/test/IntegrationTests/BuildServerIntegrationTest.cs renamed to src/Razor/Microsoft.NET.Sdk.Razor/integrationtests/BuildServerIntegrationTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using System.Diagnostics;
66
using System.IO;
77
using System.Threading.Tasks;
8-
using Microsoft.AspNetCore.Razor.Language;
98
using Microsoft.AspNetCore.Testing;
109
using Xunit;
1110

@@ -108,7 +107,7 @@ public async Task Build_ErrorInServer_DisplaysErrorInMsBuildOutput()
108107
Assert.BuildFailed(result);
109108
Assert.BuildOutputContainsLine(
110109
result,
111-
$"Invalid option 5.0 for Razor language version --version; must be Latest or a valid version in range {RazorLanguageVersion.Version_1_0} to {RazorLanguageVersion.Latest}.");
110+
$"Invalid option 5.0 for Razor language version --version; must be Latest or a valid version in range 1.0 to 3.0.");
112111

113112
// Compilation failed without creating the views assembly
114113
Assert.FileExists(result, IntermediateOutputPath, "SimpleMvc.dll");

0 commit comments

Comments
 (0)