mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-04 05:34:51 +00:00
Electron.NET Core 0.3.1 fail to compile base Blazor Web project #1044
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 @Denny09310 on GitHub (Dec 17, 2025).
Description
After upgrading Electron.NET Core from 0.3.0 to 0.3.1, the build fails with an exception related to missing metadata for generated static assets.
Environment
Error Message
I have observed the same issue in another project, where the error referenced different generated assets, such as:
*.razor.jsapp.cssExpected Behavior
The project should build successfully after upgrading Electron.NET Core from 0.3.0 to 0.3.1.
Actual Behavior
The build fails with a
SourceIdmetadata exception related to generated static web assets.Steps to Reproduce
Additional Notes
I've also saw that when re-opening the project the file affected by this exception can change, for example now it's "Components\Layout\MainLayout.razor.rz.scp.css", no idea how it calculates this static assets
electron-sample.zip
@softworkz commented on GitHub (Dec 17, 2025):
Does it get fixed when you add this:
to a PropertyGroup in the .csproj file`?
@markatosi commented on GitHub (Dec 18, 2025):
Yes, that resolves the issue for me
@Denny09310 commented on GitHub (Dec 18, 2025):
Yes that solves the issue! Thanks
@sboulema-nwwi commented on GitHub (Dec 18, 2025):
The mentioned fix does indeed fix the build of my project but upon publishing I encounter this error:
Command to publish:
dotnet publish -p:PublishProfile=win-x64Publish profile:
@FlorianRappl commented on GitHub (Dec 18, 2025):
@sboulema-nwwi sounds rather like an old version. We had this in 0.2 - can you make sure that you have a proper publish profile (it looks different to https://github.com/ElectronNET/Electron.NET/wiki/Package-Building#aspnet-application-profile-windows - e.g.,
PublishUrlis missing (there isPublishDirwhich would only be used for a console application).@sboulema-nwwi commented on GitHub (Dec 18, 2025):
Thanks for the quick answer!
Recreating the publish profiles as indicated fixed the problem.
@softworkz commented on GitHub (Dec 18, 2025):
@Denny09310 @markatosi
This PR Set PackageId from ElectronPackageId #995 should fix it.
When it's out in a new package, please test whether you can remove that property assignment.
Thanks
@Denny09310 commented on GitHub (Dec 19, 2025):
@softworkz I can confirm that updating to v0.4.0 makes the project compile correctly
@softworkz commented on GitHub (Dec 19, 2025):
Awesome, thanks a lot for confirming!