/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Components/Directory.Build.targets
27 строк
2 KB
Javier Calvarro Nelson
[Blazor] Use SDK Asset Groups for Assets.Internal and Identity UI (#66412)
01 июн 2026, 13:51
Не верифицирован
01 июн 2026, 13:51
bc4e954
Код
Авторство
О чём код?
<Project> <!-- blazor.web.js and blazor.server.js are provided by Microsoft.AspNetCore.App.Internal.Assets. blazor.webassembly.js is provided by Microsoft.AspNetCore.Components.WebAssembly. No need to set BlazorWebAssemblyJSPath for the Wasm SDK to resolve it separately. --> <!-- Add Assets.Internal reference in .targets so TargetFrameworkIdentifier is available. Exclude netstandard projects (analyzers, generators, tasks), Wasm projects (which provide their own JS via the Components.WebAssembly package), and source-only builds (Assets.Internal is excluded from source-build). --> <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(UsingMicrosoftNETSdkBlazorWebAssembly)' != 'true' and '$(DotNetBuildSourceOnly)' != 'true'"> <Reference Include="Microsoft.AspNetCore.App.Internal.Assets" PrivateAssets="All" /> </ItemGroup> <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.targets))\Directory.Build.targets" /> <!-- After ResolveReferences.targets (imported above) converts Reference to ProjectReference at evaluation time (which drops all custom metadata), re-apply metadata at evaluation time so it is always in effect for every build phase (Build, Publish, Razor, etc.): - ReferenceOutputAssembly=false: don't try to resolve/copy the DLL (the project uses CopyBuildOutputToOutputDirectory=false so no DLL exists in the output directory) - Private=false: don't copy to consuming project output - PrivateAssets=all: don't flow as a dependency to consuming packages --> <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(UsingMicrosoftNETSdkBlazorWebAssembly)' != 'true' and '$(DotNetBuildSourceOnly)' != 'true'"> <ProjectReference Update="$(RepoRoot)src\Assets\Microsoft.AspNetCore.App.Internal.Assets.csproj" ReferenceOutputAssembly="false" Private="false" PrivateAssets="all" /> </ItemGroup> </Project>