ASP.NET fails to generate CSS files in Electronize /watch mode #947

Closed
opened 2026-01-29 16:52:32 +00:00 by claunia · 1 comment
Owner

Originally created by @pawl0wski on GitHub (Apr 19, 2024).

  • Version: Electronize: 23.6.2, .NET Core 8.0, Node.js v21.7.3
  • Target: linux

When I use /watch, ASP.NET doesn't generate CSS files from *.razor.css files. This also happens when I don't use /watch, but it's occasional.

During a regular electronize start, it seems to happen very randomly. Sometimes when I add a random line of code, it suddenly fixes itself.

First scenario. When i use electronize start /watch

image

image

Start Electron Desktop Application...
Arguments: 
	watch = 
node_modules missing in: /tmp/b/obj/Host/node_modules
Start npm install...
npm install
npm WARN deprecated tslint@6.1.3: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.

added 159 packages, and audited 160 packages in 4s

26 packages are looking for funding
  run `npm fund` for details

1 moderate severity vulnerability

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.


ElectronHostHook handling started...
Invoke electron - in dir: /tmp/b/obj/Host/node_modules/.bin
./electron "../../main.js"  --watch=true
Electron Socket IO Port: 8000
Electron Socket started on port 8000 at ::1
ASP.NET Core Watch Port: 8001
stdout: dotnet watch 🔥 Hot reload enabled. For a list of supported edits, see https://aka.ms/dotnet/hot-reload.
  💡 Press "Ctrl + R" to restart.

stdout: dotnet watch 🔧 Building...

stdout:   Determining projects to restore...

stdout:   Restored /tmp/b/b.csproj (in 326 ms).

stdout:   b -> /tmp/b/bin/Debug/net8.0/b.dll

stdout: dotnet watch 🚀 Started

stdout: Use Electron Port: 8000

stdout: info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:8001

stdout: ASP.NET Core host has fully started.

stdout: info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.

stdout: info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
      Content root path: /tmp/b

ASP.NET Core Application connected... global.electronsocket Y7WWNO_O4GcYde1mAAAC 2024-04-18T23:05:00.263Z
stdout: BridgeConnector connected!

stdout: Called Event BrowserWindowCreated - data 1

[82604:0419/010501.271869:ERROR:cert_verify_proc_builtin.cc(677)] CertVerifyProcBuiltin for localhost failed:
----- Certificate i=0 (CN=localhost) -----
ERROR: No matching issuer found


[82639:0419/010501.272261:ERROR:ssl_client_socket_impl.cc(985)] handshake failed; returned -1, SSL error code 1, net_error -202

Second scenario. When i create new / move razor file.

image
image

It's very difficult to reproduce this on a new project because it happens 'randomly'. I've simulated how it looks in my main project. Basically, ASP.NET seems to not recognize the .css file when I run electronize start. However, if I open the project using dotnet run, the CSS is loaded.

If I gather more information about the second issue, I will edit it immediately.

Steps to Reproduce first scenario:

  1. Create new Blazor project dotnet new blazor
  2. Electronize it
  3. Run electronize start /watch
Originally created by @pawl0wski on GitHub (Apr 19, 2024). * **Version**: Electronize: 23.6.2, .NET Core 8.0, Node.js v21.7.3 <!-- What target are you building for? --> * **Target**: linux <!-- Enter your issue details below this comment. --> <!-- If you want, you can donate to increase issue priority (https://donorbox.org/electron-net) --> When I use /watch, ASP.NET doesn't generate CSS files from *.razor.css files. This also happens when I don't use /watch, but it's occasional. During a regular electronize start, it seems to happen very randomly. Sometimes when I add a random line of code, it suddenly fixes itself. ### First scenario. When i use `electronize start /watch` ![image](https://github.com/ElectronNET/Electron.NET/assets/59766830/d40a2037-89b1-4fe3-ab0a-c816ee799fa1) ![image](https://github.com/ElectronNET/Electron.NET/assets/59766830/7222e815-fbf0-4e57-b139-b5cfce363e48) ``` Start Electron Desktop Application... Arguments: watch = node_modules missing in: /tmp/b/obj/Host/node_modules Start npm install... npm install npm WARN deprecated tslint@6.1.3: TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information. added 159 packages, and audited 160 packages in 4s 26 packages are looking for funding run `npm fund` for details 1 moderate severity vulnerability To address all issues (including breaking changes), run: npm audit fix --force Run `npm audit` for details. ElectronHostHook handling started... Invoke electron - in dir: /tmp/b/obj/Host/node_modules/.bin ./electron "../../main.js" --watch=true Electron Socket IO Port: 8000 Electron Socket started on port 8000 at ::1 ASP.NET Core Watch Port: 8001 stdout: dotnet watch 🔥 Hot reload enabled. For a list of supported edits, see https://aka.ms/dotnet/hot-reload. 💡 Press "Ctrl + R" to restart. stdout: dotnet watch 🔧 Building... stdout: Determining projects to restore... stdout: Restored /tmp/b/b.csproj (in 326 ms). stdout: b -> /tmp/b/bin/Debug/net8.0/b.dll stdout: dotnet watch 🚀 Started stdout: Use Electron Port: 8000 stdout: info: Microsoft.Hosting.Lifetime[14] Now listening on: http://localhost:8001 stdout: ASP.NET Core host has fully started. stdout: info: Microsoft.Hosting.Lifetime[0] Application started. Press Ctrl+C to shut down. stdout: info: Microsoft.Hosting.Lifetime[0] Hosting environment: Production info: Microsoft.Hosting.Lifetime[0] Content root path: /tmp/b ASP.NET Core Application connected... global.electronsocket Y7WWNO_O4GcYde1mAAAC 2024-04-18T23:05:00.263Z stdout: BridgeConnector connected! stdout: Called Event BrowserWindowCreated - data 1 [82604:0419/010501.271869:ERROR:cert_verify_proc_builtin.cc(677)] CertVerifyProcBuiltin for localhost failed: ----- Certificate i=0 (CN=localhost) ----- ERROR: No matching issuer found [82639:0419/010501.272261:ERROR:ssl_client_socket_impl.cc(985)] handshake failed; returned -1, SSL error code 1, net_error -202 ``` ### Second scenario. When i create new / move razor file. ![image](https://github.com/ElectronNET/Electron.NET/assets/59766830/36de38f4-6c60-4847-8fa1-f8463ef873b5) ![image](https://github.com/ElectronNET/Electron.NET/assets/59766830/51b29044-5dc2-4273-b53c-0cbaf64477cf) It's very difficult to reproduce this on a new project because it happens 'randomly'. I've **simulated** how it looks in my main project. Basically, ASP.NET seems to not recognize the .css file when I run electronize start. However, if I open the project using dotnet run, the CSS is loaded. If I gather more information about the second issue, I will edit it immediately. Steps to Reproduce first scenario: 1. Create new Blazor project `dotnet new blazor` 2. Electronize it 3. Run `electronize start /watch`
claunia added the bug label 2026-01-29 16:52:32 +00:00
Author
Owner

@FlorianRappl commented on GitHub (Oct 31, 2025):

Outdated - use ElectronNET.Core and ElectronNET.Core.AspNet.

See Wiki / What's New.

@FlorianRappl commented on GitHub (Oct 31, 2025): Outdated - use `ElectronNET.Core` and `ElectronNET.Core.AspNet`. See [Wiki / What's New](https://github.com/ElectronNET/Electron.NET/wiki/What's-New).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#947