mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
Unable to Publish Project #1031
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 @AeonSake on GitHub (Dec 6, 2025).
Whenever I try to publish an ASP.NET project following the provided steps in the wiki, the build fails with the following exception when running the electron-builder:
.csproj).csproj)Steps to Reproduce:
net10.0ElectronNET.CoreandElectronNET.Core.AspNetversion 0.2.0 as NuGet packagesbuilder.UseElectron(args, ElectronAppReady);to the builder call and the following method for creating the window:Properties/PublishProfile(in this case aswin-x64.pubxml) with the following content:I also tried specifying a specific Electron and electron-builder version in the
.csprojfile without success. Normal debug/release builds and running it succeed without issues. I tried following the provided wiki pages as close as possible. If I'm doing something wrong, please correct me.Please note, that this happened in a newly created blank project. I initially ran into this same issue when reworking a more complex project (several package and project dependencies) to use this package. It might be a related issue but publishing that more complex project also DELETED ALL SOURCE FILES within that project directory. Luckily, I had all relevant changes committed or staged.
@FlorianRappl commented on GitHub (Dec 7, 2025):
Try the latest preview version of 0.3.0.
@AeonSake commented on GitHub (Dec 7, 2025):
Tried with
0.3.0-pre.314which now also deletes the entire project directory content on publish. Seems like I must have used a pre-release package in the more complex project too.The error now is:
@softworkz commented on GitHub (Dec 7, 2025):
@AeonSake - Please take a look at this: https://github.com/ElectronNET/Electron.NET/issues/946 and make sure that your project fulfills all those (not yet implemented) conditions.
@AeonSake commented on GitHub (Dec 7, 2025):
@softworkz both projects fulfill all those checks; this also happens in a brand new blank project.
@softworkz commented on GitHub (Dec 7, 2025):
Can you provide a sample project? (also in-private, if you prefer)
@AeonSake commented on GitHub (Dec 7, 2025):
Sure; here is a default Blazor Web App for net10.0 (including the default sample pages). I only added the packages, builder calls, and the publish profile from above.
If you use any 0.3.0 version, the project directory will be wiped. If you use 0.2.0 it will result in the error from above.
BlazorApp1.zip
@softworkz commented on GitHub (Dec 7, 2025):
@AeonSake
I have
There were no deletions and it's working fine:
@softworkz commented on GitHub (Dec 7, 2025):
Ah sorry - you said "on publish". I see it now.
The reason why this happens is that you are using the wrong publish profile (copied from somewhere else?)
When you use the publish wizard to publish the project, everything will be working fine.
Example:
Background: Folder publishing for ASP.Net projects is a whole different implementation, even though it looks like it was the same. The pubxml files must not be mixed between ASP.Net and other projects (like cosole app).
@AeonSake commented on GitHub (Dec 7, 2025):
Oh, interesting... I was following the wiki which listed my initial publish profile. Thanks for clarifying. It would probably be a good idea to update the wiki pages to have the correct publishing instructions.
@softworkz commented on GitHub (Dec 7, 2025):
Ohhh ouch - that was my fault!
I'm very sorry about that!
@AeonSake commented on GitHub (Dec 7, 2025):
All good, glad it was solved regardless.
@AeonSake commented on GitHub (Dec 7, 2025):
So publishing the example project now works perfectly, just not with the more complex project. But that might just be on my end. I'll try tweaking different things to hopefully get it to work. I think you can close the issue, unless you want to keep it around until the wiki is updated.
@softworkz commented on GitHub (Dec 7, 2025):
Let us know when you got any more questions!
PR submitted already: https://github.com/ElectronNET/Electron.NET/pull/965