-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Blazor: Use of --no-build
with dotnet publish
breaks content with .NET 9 SDK
#58321
Comments
--no-build
with dotnet publish
breaks content with .NET 9--no-build
with dotnet publish
breaks content with .NET 9 SDK
@javiercn I have added a minimal repro at |
@craigktreasure thanks for the additional details. Found the issue. Was likely moved into a target, and doesn't get set if the
|
Fixes #dotnet/aspnetcore#58321 The relative path was defined on a task that only ran during build, and as a result will not be set if you use `publish --no-build` resulting in the file getting copied to the wrong location.
This should take care of it dotnet/sdk#44160 |
Fixed by dotnet/sdk#44160 |
@javiercn will this be backported to .NET 9 SDK? This breaks our .NET 8 application. |
@Bouke are you saying that the fix in #58321 (comment) doesn't work for you? If so, can you file a separate issue and provide a repro? Note that you can also call publish instead of |
@javiercn it doesn't work; the published file is named <PropertyGroup Label=".NET 9 SDK shenanigans">
<JSModuleManifestRelativePath Condition="'$(JSModuleManifestRelativePath)' == ''">$(AssemblyName).modules.json</JSModuleManifestRelativePath>
</PropertyGroup> |
Agree. This is not a new issue. The original issue is not fixed. I've updated my repro to the .NET 9.0.100 SDK and the issue still exists. |
Is there an existing issue for this?
Describe the bug
TLDR
dotnet publish --no-build
when using the .NET 9 SDK, which causes incorrectly named files in thewwwroot
folder and breaks content.jsmodules.publish.manifest.json
resources are not named properly, there is no error indication as to what the problem is.Explanation
Upon upgrading to use the .NET 9 SDK, my production endpoint began showing as blank. No errors in the console and no 404 errors retrieving resources. Inspecting the page, the
body
tag has ahidden-body
class causing it to be...well...hidden. Theloading-theme
component also hasmode="null"
, which isn't expected:If I remove the
hidden-body
class exposing the page, the theme is not correct. If I attempt to interact with the theme components, I start to see errors in the console:None of this occurred building locally whether in or out of a container. I could, however, pull the production container produced by my CI and reproduce the issue.
After more head scratching than I'd care to admit, I discovered that my CI build does
dotnet publish --no-build
. After comparing the build artifacts, I discovered some files in the wwwroot folder that were different..NET 8 SDK with
dotnet publish --no-build
:• wwwroot/MyProjectName.modules.json
.NET 9 SDK with
dotnet publish --no-build
:• wwwroot/jsmodules.publish.manifest.json
.NET 9 SDK with
dotnet publish
(--no-build
removed):• wwwroot/MyProjectName.modules.json
The contents of the json files are exactly the same.
It appears that something in .NET 9 SDK with regards to the use of
--no-build
has changed copying the files with unexpected names.Workaround
Current workaround is to remove the use of the
--no-build
parameter for thepublish
command or rename the files yourself.Expected Behavior
The
MyProjectName.modules.json
files should be produced in the publish output as expected.The commands above should produce the
wwwroot/MyProjectName.modules.json
file rather thanjsmodules.publish.manifest.json
.Using the .NET 8 SDK, everything worked as expected with the use of
--no-build
.Steps To Reproduce
See https://github.com/craigktreasure/aspnet-58321-repro for a full repro of the issue.
Build a vanilla .NET 8 Fluent UI Blazor project using the following:
This will produce the
wwwroot/jsmodules.publish.manifest.json
file in the publish output.Run the application and view the page to observe a visibly blank page.
Exceptions (if any)
No response
.NET Version
9.0.100-rc.1.24452.12 and 9.0.100-rc.2.24474.11
Anything else?
No response
The text was updated successfully, but these errors were encountered: