diff --git a/src/Components/WebAssembly/Sdk/integrationtests/WasmBuildIntegrationTest.cs b/src/Components/WebAssembly/Sdk/integrationtests/WasmBuildIntegrationTest.cs index 2a0e92fcc6..df9a036a84 100644 --- a/src/Components/WebAssembly/Sdk/integrationtests/WasmBuildIntegrationTest.cs +++ b/src/Components/WebAssembly/Sdk/integrationtests/WasmBuildIntegrationTest.cs @@ -335,6 +335,16 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests Assert.BuildPassed(result); } + [Fact] + public async Task Build_WithAspNetCoreFrameworkReference_Fails() + { + // Arrange + using var project = ProjectDirectory.Create("blazorwasm-fxref"); + + var result = await MSBuildProcessManager.DotnetMSBuild(project); + Assert.BuildError(result, "BLAZORSDK1001"); + } + private static BootJsonData ReadBootJsonData(MSBuildResult result, string path) { return JsonSerializer.Deserialize( diff --git a/src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets b/src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets index e1e0a3c807..d8be7b59b1 100644 --- a/src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets +++ b/src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets @@ -631,6 +631,13 @@ Copyright (c) .NET Foundation. All rights reserved. + + + + diff --git a/src/Components/WebAssembly/Sdk/testassets/RestoreBlazorWasmTestProjects/RestoreBlazorWasmTestProjects.csproj b/src/Components/WebAssembly/Sdk/testassets/RestoreBlazorWasmTestProjects/RestoreBlazorWasmTestProjects.csproj index 46b847139d..2af6c265d4 100644 --- a/src/Components/WebAssembly/Sdk/testassets/RestoreBlazorWasmTestProjects/RestoreBlazorWasmTestProjects.csproj +++ b/src/Components/WebAssembly/Sdk/testassets/RestoreBlazorWasmTestProjects/RestoreBlazorWasmTestProjects.csproj @@ -8,6 +8,7 @@ + diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-fxref/App.razor b/src/Components/WebAssembly/Sdk/testassets/blazorwasm-fxref/App.razor new file mode 100644 index 0000000000..0c55cf88d2 --- /dev/null +++ b/src/Components/WebAssembly/Sdk/testassets/blazorwasm-fxref/App.razor @@ -0,0 +1 @@ +Hello from App \ No newline at end of file diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-fxref/Program.cs b/src/Components/WebAssembly/Sdk/testassets/blazorwasm-fxref/Program.cs new file mode 100644 index 0000000000..3ebadb8b76 --- /dev/null +++ b/src/Components/WebAssembly/Sdk/testassets/blazorwasm-fxref/Program.cs @@ -0,0 +1,11 @@ +using System; + +namespace standalone +{ + public class Program + { + public static void Main(string[] args) + { + } + } +} diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-fxref/blazorwasm-fxref.csproj b/src/Components/WebAssembly/Sdk/testassets/blazorwasm-fxref/blazorwasm-fxref.csproj new file mode 100644 index 0000000000..b9708e7e15 --- /dev/null +++ b/src/Components/WebAssembly/Sdk/testassets/blazorwasm-fxref/blazorwasm-fxref.csproj @@ -0,0 +1,31 @@ + + + + net5.0 + browser-wasm + $(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\ + $(BlazorWebAssemblySdkArtifactsDirectory)$(Configuration)\sdk-output\ + + + + + + + false + + + + + $(RepoRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\ + + + + + + + + + + + +