dotnet / dotnet/aspnetcore

Linked files in wwwroot results in "More than one compatible asset found for" error.

Open
#48,349 7 comments 1 reaction 0 assignees View on GitHub
area-blazor bug feature-static-web-assets
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Describe the bug

When linking to files in another project, such as appsettings.json, and then placing these linked files in the Blazor WASM's wwwroot project, a build error occurs with this message: **C:\Program Files\dotnet\sdk\7.0.302\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.StaticWebAssets.Pack.targets(128,5): error : More than one compatible asset found for.**

When moving the linked files out the wwwroot folder, the build completes successfully. Unfortunately, the appsettings.json file must exist in the wwwroot folder. Here is an extract from the .csproj file to make this more clear.

```





```

### Expected Behavior

The project builds successfully as if the linked files were actual files in the Blazor WASM project.

### Steps To Reproduce

_No response_

### Exceptions (if any)

_No response_

### .NET Version

7.0.302

### Anything else?

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.