diff --git a/AspNetCore.sln b/AspNetCore.sln
index 57a1bf9f0b3f..c7d7ef51fe8c 100644
--- a/AspNetCore.sln
+++ b/AspNetCore.sln
@@ -1816,6 +1816,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNetCore.OpenAp
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNetCore.App.SourceGenerators", "src\Framework\AspNetCoreAnalyzers\src\SourceGenerators\Microsoft.AspNetCore.App.SourceGenerators.csproj", "{C3928C15-1836-46DB-A09D-9EFBCCA33E08}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Assets", "Assets", "{2B858B82-5F0B-4A24-B3C0-5E99149F70D6}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNetCore.App.Internal.Assets", "src\Assets\Microsoft.AspNetCore.App.Internal.Assets.csproj", "{2AAE7819-BC3E-48F4-9CFA-5DD4CD5FFD62}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -10977,6 +10981,22 @@ Global
{C3928C15-1836-46DB-A09D-9EFBCCA33E08}.Release|x64.Build.0 = Release|Any CPU
{C3928C15-1836-46DB-A09D-9EFBCCA33E08}.Release|x86.ActiveCfg = Release|Any CPU
{C3928C15-1836-46DB-A09D-9EFBCCA33E08}.Release|x86.Build.0 = Release|Any CPU
+ {2AAE7819-BC3E-48F4-9CFA-5DD4CD5FFD62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2AAE7819-BC3E-48F4-9CFA-5DD4CD5FFD62}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2AAE7819-BC3E-48F4-9CFA-5DD4CD5FFD62}.Debug|arm64.ActiveCfg = Debug|Any CPU
+ {2AAE7819-BC3E-48F4-9CFA-5DD4CD5FFD62}.Debug|arm64.Build.0 = Debug|Any CPU
+ {2AAE7819-BC3E-48F4-9CFA-5DD4CD5FFD62}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {2AAE7819-BC3E-48F4-9CFA-5DD4CD5FFD62}.Debug|x64.Build.0 = Debug|Any CPU
+ {2AAE7819-BC3E-48F4-9CFA-5DD4CD5FFD62}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {2AAE7819-BC3E-48F4-9CFA-5DD4CD5FFD62}.Debug|x86.Build.0 = Debug|Any CPU
+ {2AAE7819-BC3E-48F4-9CFA-5DD4CD5FFD62}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2AAE7819-BC3E-48F4-9CFA-5DD4CD5FFD62}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2AAE7819-BC3E-48F4-9CFA-5DD4CD5FFD62}.Release|arm64.ActiveCfg = Release|Any CPU
+ {2AAE7819-BC3E-48F4-9CFA-5DD4CD5FFD62}.Release|arm64.Build.0 = Release|Any CPU
+ {2AAE7819-BC3E-48F4-9CFA-5DD4CD5FFD62}.Release|x64.ActiveCfg = Release|Any CPU
+ {2AAE7819-BC3E-48F4-9CFA-5DD4CD5FFD62}.Release|x64.Build.0 = Release|Any CPU
+ {2AAE7819-BC3E-48F4-9CFA-5DD4CD5FFD62}.Release|x86.ActiveCfg = Release|Any CPU
+ {2AAE7819-BC3E-48F4-9CFA-5DD4CD5FFD62}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -11874,6 +11894,8 @@ Global
{B32FF7A7-9CB3-4DCD-AE97-3B2594DB9DAC} = {2299CCD8-8F9C-4F2B-A633-9BF4DA81022B}
{B9BBC1A8-7F58-4F43-94C3-5F3CB125CEF7} = {B32FF7A7-9CB3-4DCD-AE97-3B2594DB9DAC}
{C3928C15-1836-46DB-A09D-9EFBCCA33E08} = {B5D98AEB-9409-4280-8225-9C1EC6A791B2}
+ {2B858B82-5F0B-4A24-B3C0-5E99149F70D6} = {017429CC-C5FB-48B4-9C46-034E29EE2F06}
+ {2AAE7819-BC3E-48F4-9CFA-5DD4CD5FFD62} = {2B858B82-5F0B-4A24-B3C0-5E99149F70D6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3E8720B3-DBDD-498C-B383-2CC32A054E8F}
diff --git a/eng/Build.props b/eng/Build.props
index 57f53a3ce17b..c6a1565149cf 100644
--- a/eng/Build.props
+++ b/eng/Build.props
@@ -152,6 +152,7 @@
$(RepoRoot)src\Framework\App.Ref.Internal\src\Microsoft.AspNetCore.App.Ref.Internal.csproj;
$(RepoRoot)src\Framework\AspNetCoreAnalyzers\test\Microsoft.AspNetCore.App.Analyzers.Test.csproj;
$(RepoRoot)src\Framework\test\Microsoft.AspNetCore.App.UnitTests.csproj;
+ $(RepoRoot)src\Assets\**\*.*proj;
$(RepoRoot)src\Caching\**\*.*proj;
$(RepoRoot)src\DefaultBuilder\**\*.*proj;
$(RepoRoot)src\Features\JsonPatch\**\*.*proj;
@@ -200,6 +201,7 @@
$(RepoRoot)**\obj\**\*;"
Condition=" '$(BuildMainlyReferenceProviders)' != 'true' " />
diff --git a/eng/ShippingAssemblies.props b/eng/ShippingAssemblies.props
index 0f6c1a3cdd4e..f31c7cd1b684 100644
--- a/eng/ShippingAssemblies.props
+++ b/eng/ShippingAssemblies.props
@@ -105,6 +105,7 @@
+
diff --git a/eng/scripts/npm/update-dependency-versions.mjs b/eng/scripts/npm/update-dependency-versions.mjs
index ce8b9b42c6d7..632152b69c9c 100644
--- a/eng/scripts/npm/update-dependency-versions.mjs
+++ b/eng/scripts/npm/update-dependency-versions.mjs
@@ -52,7 +52,7 @@ function applyPackageVersion(packagesToPack, defaultPackageVersion) {
renames.push([`${packagePath}.bak`, packagePath]);
process.chdir(packageDir);
- execSync(`npm version ${packageVersion} --no-git-tag-version`, { stdio: 'inherit' });
+ execSync(`npm version ${packageVersion} --no-git-tag-version --allow-same-version`, { stdio: 'inherit' });
process.chdir(currentDir);
console.log(`Applied version ${packageVersion} to ${packageName} in ${packageDir}...`);
}
diff --git a/eng/tools/GenerateFiles/Directory.Build.targets.in b/eng/tools/GenerateFiles/Directory.Build.targets.in
index ec8c64945c50..52f289a4acdd 100644
--- a/eng/tools/GenerateFiles/Directory.Build.targets.in
+++ b/eng/tools/GenerateFiles/Directory.Build.targets.in
@@ -39,6 +39,11 @@
TargetFramework="${DefaultNetCoreTargetFramework}"
Condition="'@(KnownWebAssemblySdkPack->Count())' != '0' AND
!(@(KnownWebAssemblySdkPack->AnyHaveMetadataValue('TargetFramework', '${DefaultNetCoreTargetFramework}')))" />
+
@@ -95,6 +100,11 @@
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRuntimeVersion}
+
+ ${MicrosoftAspNetCoreAppRuntimeVersion}
+
+
${MicrosoftNETCoreAppRuntimeVersion}
diff --git a/src/Assets/Microsoft.AspNetCore.App.Internal.Assets.csproj b/src/Assets/Microsoft.AspNetCore.App.Internal.Assets.csproj
new file mode 100644
index 000000000000..4ed1e5cc771c
--- /dev/null
+++ b/src/Assets/Microsoft.AspNetCore.App.Internal.Assets.csproj
@@ -0,0 +1,51 @@
+
+
+
+ $(DefaultNetCoreTargetFramework)
+ ASP.NET Core static framework assets
+ Microsoft.AspNetCore.App.Internal.Assets
+ true
+ Library
+ true
+ false
+ false
+ false
+ disable
+
+
+ $(NoWarn);NU5128
+
+
+
+ <_BlazorJSContentRoot Condition="'$(Configuration)' == 'Debug'">$(RepoRoot)src\Components\Web.JS\dist\Debug
+ <_BlazorJSContentRoot Condition="'$(Configuration)' == 'Release'">$(RepoRoot)src\Components\Web.JS\dist\Release
+
+
+
+ <_BlazorJSFile Include="$(_BlazorJSContentRoot)\blazor.web.js" />
+ <_BlazorJSFile Include="$(_BlazorJSContentRoot)\blazor.server.js" />
+ <_BlazorJSFile Include="$(_BlazorJSContentRoot)\blazor.webassembly.js" />
+
+ <_BlazorJSFile Include="$(_BlazorJSContentRoot)\blazor.web.js.map" />
+ <_BlazorJSFile Include="$(_BlazorJSContentRoot)\blazor.server.js.map" />
+ <_BlazorJSFile Include="$(_BlazorJSContentRoot)\blazor.webassembly.js.map" />
+
+
+
+
+
+
+
+
+
+
+
+ <_MissingBlazorJSFile Include="@(_BlazorJSFile)" Condition="!EXISTS('%(_BlazorJSFile.FullPath)')" />
+
+
+
+
+
+
diff --git a/src/Assets/build.cmd b/src/Assets/build.cmd
new file mode 100644
index 000000000000..5274e00264f0
--- /dev/null
+++ b/src/Assets/build.cmd
@@ -0,0 +1,3 @@
+@ECHO OFF
+SET RepoRoot=%~dp0..\..
+%RepoRoot%\eng\build.cmd -projects %~dp0**\*.*proj %*
diff --git a/src/Assets/build/Microsoft.AspNetCore.App.Internal.Assets.props b/src/Assets/build/Microsoft.AspNetCore.App.Internal.Assets.props
new file mode 100644
index 000000000000..8c119d5413b5
--- /dev/null
+++ b/src/Assets/build/Microsoft.AspNetCore.App.Internal.Assets.props
@@ -0,0 +1,2 @@
+
+
diff --git a/src/Assets/build/Microsoft.AspNetCore.App.Internal.Assets.targets b/src/Assets/build/Microsoft.AspNetCore.App.Internal.Assets.targets
new file mode 100644
index 000000000000..1d52352c6cbd
--- /dev/null
+++ b/src/Assets/build/Microsoft.AspNetCore.App.Internal.Assets.targets
@@ -0,0 +1,85 @@
+
+
+
+ $(ResolveStaticWebAssetsInputsDependsOn);
+ _AddBlazorFrameworkStaticWebAssets;
+
+
+
+
+ $(MSBuildThisFileDirectory)..\_framework
+
+
+
+
+ <_FrameworkStaticWebAssetCandidate Include="$(BlazorFrameworkStaticWebAssetRoot)\blazor.web.js" />
+ <_FrameworkStaticWebAssetCandidate Include="$(BlazorFrameworkStaticWebAssetRoot)\blazor.server.js" />
+
+
+
+ <_FrameworkStaticWebAssetCandidate Include="$(BlazorFrameworkStaticWebAssetRoot)\blazor.web.js.map" />
+ <_FrameworkStaticWebAssetCandidate Include="$(BlazorFrameworkStaticWebAssetRoot)\blazor.server.js.map" />
+
+
+
+ <_IncludeAssetsInBlazorWebAssemblyProject Condition="'$(UsingMicrosoftNETSdkBlazorWebAssembly)' == 'true' AND '$(StaticWebAssetProjectMode)' != 'Default'">true
+
+
+
+ <_FrameworkStaticWebAssetCandidate Include="$(BlazorFrameworkStaticWebAssetRoot)\blazor.webassembly.js" />
+
+
+
+ <_FrameworkStaticWebAssetCandidate Include="$(BlazorFrameworkStaticWebAssetRoot)\blazor.webassembly.js.map" />
+
+
+
+ <_FrameworkAssetsPath>$(IntermediateOutputPath)frameworkassets
+
+
+
+
+
+
+
+
+
+ <_CopiedFrameworkStaticWebAssetCandidate>
+ _framework\%(FileName)%(Extension)
+ $(_FrameworkAssetsPath)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Assets/buildMultiTargeting/Microsoft.AspNetCore.App.Internal.Assets.targets b/src/Assets/buildMultiTargeting/Microsoft.AspNetCore.App.Internal.Assets.targets
new file mode 100644
index 000000000000..37470182e922
--- /dev/null
+++ b/src/Assets/buildMultiTargeting/Microsoft.AspNetCore.App.Internal.Assets.targets
@@ -0,0 +1,3 @@
+
+
+
diff --git a/src/Assets/buildTransitive/Microsoft.AspNetCore.App.Internal.Assets.targets b/src/Assets/buildTransitive/Microsoft.AspNetCore.App.Internal.Assets.targets
new file mode 100644
index 000000000000..79251dcb3657
--- /dev/null
+++ b/src/Assets/buildTransitive/Microsoft.AspNetCore.App.Internal.Assets.targets
@@ -0,0 +1,3 @@
+
+
+
diff --git a/src/Components/Components.slnf b/src/Components/Components.slnf
index b3975358cac3..45c51cd0f4ee 100644
--- a/src/Components/Components.slnf
+++ b/src/Components/Components.slnf
@@ -4,6 +4,7 @@
"projects": [
"src\\Analyzers\\Microsoft.AspNetCore.Analyzer.Testing\\src\\Microsoft.AspNetCore.Analyzer.Testing.csproj",
"src\\Antiforgery\\src\\Microsoft.AspNetCore.Antiforgery.csproj",
+ "src\\Assets\\Microsoft.AspNetCore.App.Internal.Assets.csproj",
"src\\Components\\Analyzers\\src\\Microsoft.AspNetCore.Components.Analyzers.csproj",
"src\\Components\\Analyzers\\test\\Microsoft.AspNetCore.Components.Analyzers.Tests.csproj",
"src\\Components\\Authorization\\src\\Microsoft.AspNetCore.Components.Authorization.csproj",
@@ -156,4 +157,4 @@
"src\\WebEncoders\\src\\Microsoft.Extensions.WebEncoders.csproj"
]
}
-}
\ No newline at end of file
+}
diff --git a/src/Components/Directory.Build.props b/src/Components/Directory.Build.props
index 45dda95456a2..84597f2f45f6 100644
--- a/src/Components/Directory.Build.props
+++ b/src/Components/Directory.Build.props
@@ -18,4 +18,13 @@
false
+
+
+ true
+ $(RepoRoot)src\Components\Web.JS\dist\Debug
+ $(RepoRoot)src\Components\Web.JS\dist\Release
+
+
+
+
diff --git a/src/Components/Directory.Build.targets b/src/Components/Directory.Build.targets
index 9daad5570fdc..35886951b6aa 100644
--- a/src/Components/Directory.Build.targets
+++ b/src/Components/Directory.Build.targets
@@ -1,21 +1,3 @@
-
- $(RepoRoot)src\Components\Web.JS\dist\Debug\blazor.webassembly.js
- $(RepoRoot)src\Components\Web.JS\dist\Release\blazor.webassembly.js
- $(BlazorWebAssemblyJSPath).map
-
- <_BlazorDevServerPath>$(ArtifactsDir)bin/Microsoft.AspNetCore.Components.WebAssembly.DevServer/$(Configuration)/$(DefaultNetCoreTargetFramework)/blazor-devserver.dll
- dotnet
- <_RunExtraArguments Condition="'$(WasmEnableThreads)' == 'true'">--apply-cop-headers
- exec "$(_BlazorDevServerPath)" --applicationpath "$(TargetPath)" $(_RunExtraArguments) $(AdditionalRunArguments)
-
-
-
-
-
-
diff --git a/src/Components/Endpoints/src/Builder/RazorComponentEndpointDataSource.cs b/src/Components/Endpoints/src/Builder/RazorComponentEndpointDataSource.cs
index d4ca799ba4bc..a81610542792 100644
--- a/src/Components/Endpoints/src/Builder/RazorComponentEndpointDataSource.cs
+++ b/src/Components/Endpoints/src/Builder/RazorComponentEndpointDataSource.cs
@@ -10,9 +10,6 @@
using Microsoft.AspNetCore.Components.Endpoints.Infrastructure;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
-using Microsoft.AspNetCore.Routing.Patterns;
-using Microsoft.AspNetCore.StaticFiles;
-using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Primitives;
using static Microsoft.AspNetCore.Internal.LinkerFlags;
@@ -180,7 +177,6 @@ private void UpdateEndpoints()
private void AddBlazorWebEndpoints(List endpoints)
{
List blazorWebEndpoints = [
- ..GetBlazorWebJsEndpoint(_endpointRouteBuilder),
OpaqueRedirection.GetBlazorOpaqueRedirectionEndpoint()];
foreach (var endpoint in blazorWebEndpoints)
@@ -199,56 +195,6 @@ private void AddBlazorWebEndpoints(List endpoints)
}
}
- private static IEnumerable GetBlazorWebJsEndpoint(IEndpointRouteBuilder endpoints)
- {
- var app = endpoints.CreateApplicationBuilder();
-
- var options = new StaticFileOptions
- {
- FileProvider = new ManifestEmbeddedFileProvider(typeof(RazorComponentsEndpointRouteBuilderExtensions).Assembly),
- OnPrepareResponse = CacheHeaderSettings.SetCacheHeaders
- };
-
- app.Use(next => context =>
- {
- // Set endpoint to null so the static files middleware will handle the request.
- context.SetEndpoint(null);
-
- return next(context);
- });
-
- app.UseStaticFiles(options);
-
- var requestDelegate = app.Build();
-
- var blazorWebJsBuilder = new RouteEndpointBuilder(
- requestDelegate,
- RoutePatternFactory.Parse("/_framework/blazor.web.js"),
- int.MinValue)
- {
- DisplayName = "Blazor web static files"
- };
-
- var allowedHttpMethods = new HttpMethodMetadata([HttpMethods.Get, HttpMethods.Head]);
- blazorWebJsBuilder.Metadata.Add(allowedHttpMethods);
-
-#if !DEBUG
- return [blazorWebJsBuilder];
-#else
- // We only need to serve the sourcemap when working on the framework, not in the distributed packages
- var blazorWebJsDebugBuilder = new RouteEndpointBuilder(
- requestDelegate,
- RoutePatternFactory.Parse("/_framework/blazor.web.js.map"),
- int.MinValue)
- {
- DisplayName = "Blazor web static files sourcemap"
- };
- blazorWebJsDebugBuilder.Metadata.Add(allowedHttpMethods);
-
- return [blazorWebJsBuilder, blazorWebJsDebugBuilder];
-#endif
- }
-
public void OnHotReloadClearCache(Type[]? types)
{
lock (_lock)
diff --git a/src/Components/Endpoints/src/Directory.Build.targets b/src/Components/Endpoints/src/Directory.Build.targets
index 09953b9b6c9d..35886951b6aa 100644
--- a/src/Components/Endpoints/src/Directory.Build.targets
+++ b/src/Components/Endpoints/src/Directory.Build.targets
@@ -1,6 +1,3 @@
-
-
diff --git a/src/Components/Endpoints/src/Microsoft.AspNetCore.Components.Endpoints.csproj b/src/Components/Endpoints/src/Microsoft.AspNetCore.Components.Endpoints.csproj
index f88a64780683..5362350bb1d7 100644
--- a/src/Components/Endpoints/src/Microsoft.AspNetCore.Components.Endpoints.csproj
+++ b/src/Components/Endpoints/src/Microsoft.AspNetCore.Components.Endpoints.csproj
@@ -8,18 +8,10 @@
true
$(NoWarn);CS0436
false
- Microsoft.Extensions.FileProviders.Embedded.Manifest.xml
enable
$(DefineConstants);COMPONENTS
-
-
- <_FileProviderTaskAssembly>$(ArtifactsDir)bin\Microsoft.Extensions.FileProviders.Embedded.Manifest.Task\$(Configuration)\netstandard2.0\Microsoft.Extensions.FileProviders.Embedded.Manifest.Task.dll
-
-
-
-
@@ -57,31 +49,8 @@
-
-
- blazor.web.js
-
- ..\..\Web.JS\dist\Debug\$(BlazorWebJSFilename)
- ..\..\Web.JS\dist\Release\$(BlazorWebJSFilename)
-
-
-
-
-
-
- ..\..\Web.JS\dist\Release\$(BlazorWebJSFilename)
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Components/Endpoints/test/Builder/RazorComponentsEndpointConventionBuilderExtensionsTest.cs b/src/Components/Endpoints/test/Builder/RazorComponentsEndpointConventionBuilderExtensionsTest.cs
index e5378452934e..70fa780fcbaf 100644
--- a/src/Components/Endpoints/test/Builder/RazorComponentsEndpointConventionBuilderExtensionsTest.cs
+++ b/src/Components/Endpoints/test/Builder/RazorComponentsEndpointConventionBuilderExtensionsTest.cs
@@ -217,7 +217,6 @@ public void WithStaticAssets_DoesNotAddResourceCollectionFromGroup_WhenMappingNo
}
[Theory]
- [InlineData("/_framework/blazor.web.js")]
[InlineData("/_framework/opaque-redirect")]
public void MapRazorComponents_CanAddConventions_ToBlazorWebEndpoints(string frameworkEndpoint)
{
diff --git a/src/Components/Endpoints/test/RazorComponentEndpointDataSourceTest.cs b/src/Components/Endpoints/test/RazorComponentEndpointDataSourceTest.cs
index 840a865accd2..52cd757d62ab 100644
--- a/src/Components/Endpoints/test/RazorComponentEndpointDataSourceTest.cs
+++ b/src/Components/Endpoints/test/RazorComponentEndpointDataSourceTest.cs
@@ -27,11 +27,7 @@ public void RegistersEndpoints()
var endpoints = endpointDataSource.Endpoints;
-#if DEBUG
- Assert.Equal(5, endpoints.Count);
-#else
- Assert.Equal(4, endpoints.Count);
-#endif
+ Assert.Equal(3, endpoints.Count);
}
[Fact]
@@ -44,11 +40,7 @@ public void NoDiscoveredModesDefaultsToStatic()
var endpoints = endpointDataSource.Endpoints;
-#if DEBUG
- Assert.Equal(3, endpoints.Count);
-#else
- Assert.Equal(2, endpoints.Count);
-#endif
+ Assert.Single(endpoints);
}
// renderModes, providers, components, expectedEndpoints
diff --git a/src/Components/Samples/BlazorUnitedApp/App.razor b/src/Components/Samples/BlazorUnitedApp/App.razor
index 2310b92b1848..e04f7fc9e8e4 100644
--- a/src/Components/Samples/BlazorUnitedApp/App.razor
+++ b/src/Components/Samples/BlazorUnitedApp/App.razor
@@ -15,6 +15,6 @@
-
+