-
Notifications
You must be signed in to change notification settings - Fork 517
Description
Just a quick heads-up: while testing .NET 10, we noticed a potential compatibility issue that affect GrandNode2 app.
Specifically, if there are references between web projects (WebApp → WebApp) that depend on loading static assets via _content/XXX paths, this is no longer supported in .NET 10.
The issue is tracked here:
👉 dotnet/aspnetcore#62138
Summary:
.NET 10 introduces a change where WebApp-to-WebApp references are not supported for static web assets. Previously, static assets could sometimes be shared across web projects, but in .NET 10, the SDK explicitly restricts this behavior.
WebApps now define static asset base paths as /, which prevents referencing their _content/XXX assets from other web apps.
This scenario is officially unsupported.
The workaround is to manually set the base path in the referenced project using:
<StaticWebAssetBasePath>_content/$(MSBuildProjectName)</StaticWebAssetBasePath>
Repro steps:
- The machine has dotnet-sdk-10.0.100-preview.5.25272.110 installed.
- Create a global.json file to make it target .NET 10.
- Run the command dotnet build in the grandnode2\src\Web\Grand.Web directory.
Build failed with error:
Conflicting assets with the same target path 'assets/images/flags/ad#[.{fingerprint}]?.png'. For assets 'Identity: D:\grandnode2\src\Web\Grand.Web.Admin\wwwroot\assets\images\flags\ad.png, SourceType: Project, SourceId: Grand.Web.Admin, ContentRoot: D:\grandnode2\src\Web\Grand.Web.Admin\wwwroot\, BasePath: /, RelativePath: assets/images/flags/ad#[.{fingerprint}]?.png, AssetKind: All, AssetMode: All, AssetRole: Primary, AssetRole: , AssetRole: , RelatedAsset: , AssetTraitName: , AssetTraitValue: , Fingerprint: 1smjfebmi3, Integrity: EZFwYCjTmh1ez2xocsIWUdYRgowFz+BGwrL1GuPYpNI=, FileLength: 326, LastWriteTime: 8/8/2024 2:51:31 AM +00:00, CopyToOutputDirectory: Never, CopyToPublishDirectory: PreserveNewest, OriginalItemSpec: wwwroot\assets\images\flags\ad.png' and 'Identity: D:\grandnode2\src\Web\Grand.Web.Vendor\wwwroot\assets\images\flags\ad.png, SourceType: Project, SourceId: Grand.Web.Vendor, ContentRoot: D:\grandnode2\src\Web\Grand.Web.Vendor\wwwroot\, BasePath: /, RelativePath: assets/images/flags/ad#[.{fingerprint}]?.png, AssetKind: All, AssetMode: All, AssetRole: Primary, AssetRole: , AssetRole: , RelatedAsset: , AssetTraitName: , AssetTraitValue: , Fingerprint: 1smjfebmi3, Integrity: EZFwYCjTmh1ez2xocsIWUdYRgowFz+BGwrL1GuPYpNI=, FileLength: 326, LastWriteTime: 8/8/2024 2:51:58 AM +00:00, CopyToOutputDirectory: Never, CopyToPublishDirectory: PreserveNewest, OriginalItemSpec: wwwroot\assets\images\flags\ad.png' from different projects.