-
Notifications
You must be signed in to change notification settings - Fork 390
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
Use of --no-build
with dotnet publish
breaks content with .NET 9
#2778
Comments
Thank you for the comprehensive issue report! I can see that this is a problem, but I am unsure if there is anything we can do about it. I don't want it to appear as if I'm sending you off into the woods, but I think this is more an issue that should be raised in the ASP.NET Core repo. Don't you think so? |
Ha. Yes. You're absolutely right. I initially thought it was a Fluent UI problem and got so caught up in writing the report that I misplaced it. I'll refile in ASP.NET. |
Ok, closing this one on this side then. |
@vnbaaij Do you happen to know what produces the |
I'm guessing it is coming from our
|
I would just like to leave this here. But this happened for us as well, and we were running .net 8.0.x. Probably some small change by Microsoft changed this. Removing --no-build resolved it. |
|
Yes, but in our case, we were not even using .net 9 SDK, but .net 8 SDK. Just FYI 😊 |
🐛 Bug Report
Summary
dotnet publish --no-build
when using .NET 9.*.publish.manifest.json
resources are not named properly, there is no error indication as to what the problem is.Explanation
Upon upgrading to .NET 9, 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 with
dotnet publish --no-build
:• wwwroot/MyProjectName.publish.manifest.json
.NET 9 with
dotnet publish --no-build
:• wwwroot/jsmodules.publish.manifest.json
• wwwroot/jsmodules.publish.manifest.json.br
• wwwroot/jsmodules.publish.manifest.json.gz
.NET 9 with
dotnet publish
(--no-build
removed):• wwwroot/MyProjectName.publish.manifest.json
• wwwroot/MyProjectName.publish.manifest.json.br
• wwwroot/MyProjectName.publish.manifest.json.gz
The contents of the json files are exactly the same.
It appears that something in .NET 9 with regards to the use of
--no-build
has changed copying the files with unexpected names.💻 Repro or Code Sample
Build a .NET 9 Blazor project using the following:
This will produce the following files in the publish output:
• wwwroot/jsmodules.publish.manifest.json
• wwwroot/jsmodules.publish.manifest.json.br
• wwwroot/jsmodules.publish.manifest.json.gz
🤔 Expected Behavior
The
MyProjectName.publish.manifest.json*
files should be produced in the publish output as expected.The commands above should produce the following files named with
MyProjectName.*
rather thanjsmodules.*
:• wwwroot/MyProjectName.publish.manifest.json
• wwwroot/MyProjectName.publish.manifest.json.br
• wwwroot/MyProjectName.publish.manifest.json.gz
In .NET 8, everything worked as expected with the use of
--no-build
.😯 Current Behavior
The commands above produce the following files incorrectly named:
• wwwroot/jsmodules.publish.manifest.json
• wwwroot/jsmodules.publish.manifest.json.br
• wwwroot/jsmodules.publish.manifest.json.gz
When you run the application in this way, you'll get a blank screen with no errors in the console and no network request errors. There's not much indication as to what went wrong or what's missing.
💁 Possible Solution
Current workaround is to remove the use of the
--no-build
parameter for thepublish
command.🔦 Context
I typically use
--no-build
to speed up thepublish
command a bit. Also, it just seems unnecessary to allow further build after you've already performed a build.🌍 Your Environment
The text was updated successfully, but these errors were encountered: