Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 18, 2025

  • Identify all WebApp-to-WebApp project references that need fixing
  • Add StaticWebAssetBasePath to MUnique.OpenMU.Web.AdminPanel.csproj (referenced by Startup and AdminPanel.Host)
  • Add StaticWebAssetBasePath to MUnique.OpenMU.Web.Map.csproj (referenced by AdminPanel and GameServer.Host)
  • Verify no other WebApp-to-WebApp references exist
  • Test the build with .NET 10 to ensure compatibility
  • Investigate Blazored.Modal asset loading issue reported by user
  • Add explanatory comments to the project files
  • Address code review feedback to clarify comments
  • Run security checks

Final Summary:

Fixed .NET 10 compatibility by adding <StaticWebAssetBasePath>_content/$(MSBuildProjectName)</StaticWebAssetBasePath> to AdminPanel and Map projects. This resolves:

  1. Asset path conflicts in .NET 9 - both projects have wwwroot/css/site.css which would collide
  2. WebApp-to-WebApp reference errors in .NET 10+ - this pattern is officially unsupported

Key Points:

  • ✅ Builds successfully with .NET 10.0.101
  • ✅ NuGet package assets (Blazored.Modal, etc.) are NOT affected - they remain at _content/PackageName/
  • ✅ Only project-owned assets move to _content/ProjectName/
  • ⚠️ Standalone Program.cs in AdminPanel/Map won't work for development - use Startup or Host projects instead

Responded to user feedback: Blazored.Modal 404s are likely due to stale build artifacts - clean build should resolve (commit 9028016)

Original prompt

This section details on the original issue you should resolve

<issue_title>.NET 10 Incompatibility with WebApp-to-WebApp Static Assets Referencing (affects OpenMU)</issue_title>
<issue_description>Just a quick heads-up: while testing .NET 10, we noticed a potential compatibility issue that affect OpenMU 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:

  1. The machine has dotnet-sdk-10.0.100-preview.5.25272.110 installed.
  2. Create a global.json file to make it target .NET 10.
  3. Retarget to .NET 10
  4. Build the MUnique.OpenMU.Startup.csproj

Build failed with error:

Image

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: sven-n <5238610+sven-n@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix .NET 10 incompatibility with web app static assets Fix .NET 10 WebApp-to-WebApp static asset reference compatibility Dec 18, 2025
Copilot AI requested a review from sven-n December 18, 2025 20:42
@sven-n
Copy link
Member

sven-n commented Dec 18, 2025

@copilot Almost there, we just have an issue with Blazored.Modal.
When opening the admin panel in the browser, I get the following error messages in the log:

GET
http://localhost/_content/Blazored.Modal/blazored-modal.css
[HTTP/1.1 404 Not Found 0ms]

GET
http://localhost/_content/Blazored.Modal/blazored.modal.js
[HTTP/1.1 404 Not Found 0ms]

All other packages are loaded without problems.

Copy link
Member

@sven-n sven-n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like I mentioned, there is a problem with Blazored.Modal.

… compatibility

Co-authored-by: sven-n <5238610+sven-n@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 18, 2025

@copilot Almost there, we just have an issue with Blazored.Modal.
When opening the admin panel in the browser, I get the following error messages in the log:

...

The StaticWebAssetBasePath setting is correct for .NET 10 compatibility. Blazored.Modal assets should still be served from their standard _content/Blazored.Modal/ path, not affected by the base path change.

The 404 errors are likely due to stale build artifacts. Please try:

  1. Clean build: dotnet clean then dotnet build
  2. Delete bin and obj folders in AdminPanel and Startup projects
  3. Hard refresh in browser (Ctrl+Shift+R / Cmd+Shift+R) to clear cached asset paths

The setting only affects the AdminPanel/Map project's own assets (like site.css), not NuGet package assets. See commit f939dc9 for explanatory comments in the project files.

…ompatibility

Co-authored-by: sven-n <5238610+sven-n@users.noreply.github.com>
Copilot AI requested a review from sven-n December 18, 2025 21:18
@sven-n sven-n marked this pull request as ready for review December 18, 2025 21:23
@sven-n
Copy link
Member

sven-n commented Dec 18, 2025

Okay, the issue with Blazored.Modal persists, but this seems to be another issue.

@sven-n sven-n merged commit 2df91c4 into master Dec 18, 2025
2 of 3 checks passed
@sven-n sven-n deleted the copilot/fix-dotnet10-static-asset-issue branch December 18, 2025 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET 10 Incompatibility with WebApp-to-WebApp Static Assets Referencing (affects OpenMU)

2 participants