mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
Application break if the name contains a dot! (Blazor) #1040
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @GianlucaLocri on GitHub (Dec 15, 2025).
Steps to Reproduce:
@AeonSake commented on GitHub (Dec 15, 2025):
My app contains a dot, and it still works though? Maybe it's a net8.0-specific issue.
@FlorianRappl commented on GitHub (Dec 15, 2025):
My projects also contain a name - works.
Please provide a reproducible, otherwise we cannot investigate this. What I suspect is that you are actually facing another issue - as you wrote... mysterious ;).
@GianlucaLocri commented on GitHub (Dec 16, 2025):
I tried with .net9 and same result :(
I've attached 4 super minimal samples (two in .net8 and two in .net9). As you can see, project with a dot in name result in rendering error...
I cannot really understand the source of that behaviour...
samples.zip
@GianlucaLocri commented on GitHub (Dec 16, 2025):
@GianlucaLocri commented on GitHub (Dec 16, 2025):
Apparently .net10 works. But it is very strange... So is .Net <10 not supported by this?
@FlorianRappl commented on GitHub (Dec 16, 2025):
No that has nothing to do with it. As mentioned my example also worked and it's .NET 8.
Also I won't open the zip. Please provide reproducibles in form of a repo hosted here. Thanks!
@GianlucaLocri commented on GitHub (Dec 16, 2025):
@FlorianRappl here it is the repo. I included only the problematic .net8 sample.
https://github.com/GianlucaLocri/ElectronNET-Blazor8.UI-Sample
many thanks for your support!
@markatosi commented on GitHub (Dec 16, 2025):
When i look in the web dev console the isolated css file is not found and or generated on windows. Works fine on mac.
@AeonSake commented on GitHub (Dec 16, 2025):
replace the dot with a dash for the isolated CSS path:
<link rel="stylesheet" href="@Assets["Blazor8-UI.styles.css"]" />@GianlucaLocri commented on GitHub (Dec 16, 2025):
@markatosi OMG you are a lifesaver mate...
I've done this:
<link rel="stylesheet" href="Blazor8-UI.styles.css" />since @Assets seems to be a .net9+ thing, and now it is working as expected!
Just to be precise, I even discovered that the simple installation of ElectronNET.Core break the project without touching anything else!
So, starting from the plain blazor sample and doing
dotnet add package ElectronNET.Corewill raise the issue for me.That was really driving me crazy. I don't fully understand why this is the case, but at least I have a fix now.
@FlorianRappl commented on GitHub (Dec 16, 2025):
Can we be precise about "break the project"? Because what I initially thought is that nothing starts or works, but now it seems to be a discussion about the CSS / asset path, which actually is anyway an anti-pattern with the provided name. I'd rename the asset to app.css and live happily in any case (dot, dash, whatever - should not be that verbose for no reason)...
I don't think we do anything in that area - so I don't see it in our responsibility to change here something (but I will check to verify).
@markatosi commented on GitHub (Dec 16, 2025):
@AeonSake was the one that responded with the answer. The default settings for the project file if you do not change them replace dots with dashes
https://github.com/ElectronNET/Electron.NET/wiki/Configuration
@AeonSake commented on GitHub (Dec 16, 2025):
Yea, I had to double-check my solution and noticed I also had to replace the dot with a dash...it just had been so long that I completely forgot I had to do it in the first place. I'm also unsure why this is even a thing.
This has nothing to do with your own static assets, but rather with the CSS bundle file generated for your CSS isolation files (i.e., the CSS files colocated with Razor components such as
MyComponent.razor.css). They get bundled and named after the assembly with that weird dash-instead-of-dot quirk.@AeonSake commented on GitHub (Dec 16, 2025):
Ohhh... yea, that would explain why I didn't have any issues with other ASP.NET applications or host systems (like Photino.NET).
@softworkz commented on GitHub (Dec 16, 2025):
Okay, thanks for the investigations. Seems that one goes on me.
I didn't expect that PackageId would be used for anything else than nuget package creation.
I think we need to change this to use a different property name.
@softworkz commented on GitHub (Dec 16, 2025):
Addressed in this PR: https://github.com/ElectronNET/Electron.NET/pull/990
Please test, I'm short on time unfortunately.
@FlorianRappl commented on GitHub (Dec 16, 2025):
Fixed in 0.3.1