Skip to content

[dotnet-sdk-10.0.100-preview.5.25272.110] Apps build failed with error "Conflicting assets with the same target path" #62138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
1 task done
Junjun-zhao opened this issue May 28, 2025 · 3 comments
Labels
area-ui-rendering Includes: MVC Views/Pages, Razor Views/Pages Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update.

Comments

@Junjun-zhao
Copy link
Member

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Starting from .NET 10 Preview 4, building the third-party applications with the latest .NET 10 build, it fails with error "Conflicting assets with the same target path" if there are two wwwroot folders.

Application Name: grandnode2, OpenMU
OS: Windows 10 21H2
CPU: X64
.NET Build Number: dotnet-sdk-10.0.100-preview.5.25272.110
App Source checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2492267
Or Github Link:
https://github.com/grandnode/grandnode2
https://github.com/MUnique/OpenMU

Verify Scenarios:
1). Windows 10 21H2 AMD64 + dotnet-sdk-8.0.400: Pass
2). Windows 10 21H2 AMD64 + dotnet-sdk-9.0.104: Pass
3). Windows 10 21H2 AMD64 + dotnet-sdk-10.0.100-preview.3.25201.16: Pass
4). Windows 10 21H2 AMD64 + dotnet-sdk-10.0.100-preview.4.25258.110: Fail
5). Windows 10 21H2 AMD64 + dotnet-sdk-10.0.100-preview.5.25272.110: Fail

Expected Behavior

Build successfully.

Steps To Reproduce

App Repro Steps:
The machine has dotnet-sdk-10.0.100-preview.5.25272.110 installed.

  1. Run command "dotnet build" in grandnode2\src\Web\Grand.Web.

Demo Repro Steps: (Demo attached: WebDemo)
The machine has dotnet-sdk-10.0.100-preview.5.25272.110 installed.

  1. Create asp .net web 8.0 project WebApp01 and asp .net web 8.0 project WebApp02.
  2. WebApp01 references WebApp02.
  3. Build WebApp01.

Exceptions (if any)

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.

.NET Version

10.0.100-preview.5.25272.110

Anything else?

Findings:
If delete grandnode2\src\Web\Grand.Web.Vendor\wwwroot and grandnode2\src\Web\Grand.Web.Admin\wwwroot, Grand.Web can build successfully.

Dotnet Info:

.NET SDK:
 Version:           10.0.100-preview.5.25272.110
 Commit:            35674fa72e
 Workload version:  10.0.100-manifests.f4c93f91
 MSBuild version:   17.15.0-preview-25272-110+35674fa72

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19045
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\10.0.100-preview.5.25272.110\

Host:
  Version:      10.0.0-preview.5.25272.110
  Architecture: x64
  Commit:       35674fa72e

.NET SDKs installed:
  10.0.100-preview.5.25272.110 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 10.0.0-preview.5.25272.110 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 10.0.0-preview.5.25272.110 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 10.0.0-preview.5.25272.110 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

@dotnet-actwx-bot @dotnet/compat

@github-actions github-actions bot added the needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically label May 28, 2025
@martincostello martincostello added area-blazor Includes: Blazor, Razor Components and removed needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically labels May 28, 2025
@javiercn
Copy link
Member

javiercn commented May 28, 2025

The two projects seem to be webapps referencing webapps, which is not supported by static web assets. Only class libraries or Blazor apps can be referenced by webapps in a supported capacity.

The issue is that the base path in the path would be _content/$(PackageId) by default and the SDK now defines the base path on root projects (Blazor, WebApps) specifically as /.

This is not a supported scenario, but it can be made work by explicitly providing the base path on the project being referenced.

<StaticWebAssetBasePath>_content/$(MSBuildProjectName)</StaticWebAssetBasePath>

@javiercn javiercn added area-ui-rendering Includes: MVC Views/Pages, Razor Views/Pages and removed area-blazor Includes: Blazor, Razor Components labels May 28, 2025
@MackinnonBuck
Copy link
Member

@Junjun-zhao, does the workaround suggested by @javiercn resolve your issue?

@MackinnonBuck MackinnonBuck added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label May 28, 2025
@Junjun-zhao
Copy link
Member Author

Hi @javiercn @martincostello Thanks for the quick response, the apps work with the workaround. Could you please share which change caused this behavior change? Will this be documented as breaking change? There are two apps affected in Appcompat Lab, maybe more real-world users will be affected. It will be better to document it as breaking change if it is not. Thanks.

@dotnet-policy-service dotnet-policy-service bot added Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-ui-rendering Includes: MVC Views/Pages, Razor Views/Pages Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update.
Projects
None yet
Development

No branches or pull requests

4 participants