Application break if the name contains a dot! (Blazor) #1040

Closed
opened 2026-01-29 16:56:16 +00:00 by claunia · 17 comments
Owner

Originally created by @GianlucaLocri on GitHub (Dec 15, 2025).

  • Version: ElectronNET.Core 0.3.0 Latest
  • Target: .net 8

Steps to Reproduce:

  1. Create a new Blazor Web App project. Important! include a dot in the name like "BlazorApp.UI"
  2. Follow instructions on main repo page for blazor project (so program.cs will contain the line app.MapRazorComponents<BlazorApp.UI.Components.App>();)
  3. Enjoy a mysterious unhandled error
Originally created by @GianlucaLocri on GitHub (Dec 15, 2025). * **Version**: ElectronNET.Core 0.3.0 Latest * **Target**: .net 8 Steps to Reproduce: 1. Create a new Blazor Web App project. Important! include a dot in the name like "BlazorApp.UI" 2. Follow instructions on main repo page for blazor project (so program.cs will contain the line app.MapRazorComponents<BlazorApp.UI.Components.App>();) 3. Enjoy a mysterious unhandled error
claunia added the bugdev-experience labels 2026-01-29 16:56:16 +00:00
Author
Owner

@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.

@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.
Author
Owner

@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 ;).

@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 ;).
Author
Owner

@GianlucaLocri commented on GitHub (Dec 16, 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 ;).

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): > 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 ;). 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](https://github.com/user-attachments/files/24187676/samples.zip)
Author
Owner

@GianlucaLocri commented on GitHub (Dec 16, 2025):

Image This appears in the electron window DevTools. Have you any idea of what to look for? I am really squeezing my head for days.
@GianlucaLocri commented on GitHub (Dec 16, 2025): <img width="1088" height="593" alt="Image" src="https://github.com/user-attachments/assets/96051cf4-0bee-4d53-a0bc-77a98fb6b2ce" /> This appears in the electron window DevTools. Have you any idea of what to look for? I am really squeezing my head for days.
Author
Owner

@GianlucaLocri commented on GitHub (Dec 16, 2025):

Apparently .net10 works. But it is very strange... So is .Net <10 not supported by this?

@GianlucaLocri commented on GitHub (Dec 16, 2025): Apparently .net10 works. But it is very strange... So is .Net <10 not supported by this?
Author
Owner

@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!

@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!
Author
Owner

@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!

@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!
Author
Owner

@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.

@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.
Author
Owner

@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"]" />

@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"]" />`
Author
Owner

@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.Core will 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.

@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.Core` will 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.
Author
Owner

@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).

@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).
Author
Owner

@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

<PropertyGroup Label="ElectronNetCommon">
    <ElectronVersion>30.4.0</ElectronVersion>
    <ElectronBuilderVersion>26.0</ElectronBuilderVersion>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <ElectronSingleInstance>true</ElectronSingleInstance>
    <ElectronSplashScreen></ElectronSplashScreen>
    <ElectronIcon></ElectronIcon>
    <PackageId>$(MSBuildProjectName.Replace(".", "-").ToLower())</PackageId> <==== HERE BE STUFF
    <ElectronBuilderJson>electron-builder.json</ElectronBuilderJson>
    <Title>$(MSBuildProjectName)</Title>
</PropertyGroup> 
@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 ``` <PropertyGroup Label="ElectronNetCommon"> <ElectronVersion>30.4.0</ElectronVersion> <ElectronBuilderVersion>26.0</ElectronBuilderVersion> <RuntimeIdentifier>win-x64</RuntimeIdentifier> <ElectronSingleInstance>true</ElectronSingleInstance> <ElectronSplashScreen></ElectronSplashScreen> <ElectronIcon></ElectronIcon> <PackageId>$(MSBuildProjectName.Replace(".", "-").ToLower())</PackageId> <==== HERE BE STUFF <ElectronBuilderJson>electron-builder.json</ElectronBuilderJson> <Title>$(MSBuildProjectName)</Title> </PropertyGroup> ```
Author
Owner

@AeonSake commented on GitHub (Dec 16, 2025):

That was really driving me crazy. I don't fully understand why this is the case, but at least I have a fix now.

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.

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)...

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): > That was really driving me crazy. I don't fully understand why this is the case, but at least I have a fix now. 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. > 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)... 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.
Author
Owner

@AeonSake 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

<PropertyGroup Label="ElectronNetCommon">
    <ElectronVersion>30.4.0</ElectronVersion>
    <ElectronBuilderVersion>26.0</ElectronBuilderVersion>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <ElectronSingleInstance>true</ElectronSingleInstance>
    <ElectronSplashScreen></ElectronSplashScreen>
    <ElectronIcon></ElectronIcon>
    <PackageId>$(MSBuildProjectName.Replace(".", "-").ToLower())</PackageId> <==== HERE BE STUFF
    <ElectronBuilderJson>electron-builder.json</ElectronBuilderJson>
    <Title>$(MSBuildProjectName)</Title>
</PropertyGroup> 

Ohhh... yea, that would explain why I didn't have any issues with other ASP.NET applications or host systems (like Photino.NET).

@AeonSake commented on GitHub (Dec 16, 2025): > [@AeonSake](https://github.com/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 > > ``` > <PropertyGroup Label="ElectronNetCommon"> > <ElectronVersion>30.4.0</ElectronVersion> > <ElectronBuilderVersion>26.0</ElectronBuilderVersion> > <RuntimeIdentifier>win-x64</RuntimeIdentifier> > <ElectronSingleInstance>true</ElectronSingleInstance> > <ElectronSplashScreen></ElectronSplashScreen> > <ElectronIcon></ElectronIcon> > <PackageId>$(MSBuildProjectName.Replace(".", "-").ToLower())</PackageId> <==== HERE BE STUFF > <ElectronBuilderJson>electron-builder.json</ElectronBuilderJson> > <Title>$(MSBuildProjectName)</Title> > </PropertyGroup> > ``` Ohhh... yea, that would explain why I didn't have any issues with other ASP.NET applications or host systems (like Photino.NET).
Author
Owner

@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): 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.
Author
Owner

@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.

@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.
Author
Owner

@FlorianRappl commented on GitHub (Dec 16, 2025):

Fixed in 0.3.1

@FlorianRappl commented on GitHub (Dec 16, 2025): Fixed in 0.3.1
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#1040