-
-
Notifications
You must be signed in to change notification settings - Fork 733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error compiling a Blazor 'client-side' project on .NET 5 #532
Comments
I am seeing this error and couldn't find a workaround |
you can pass in overrides on the PublishSingleFile when running electronize build. I believe its of the form like this.
|
Instead, But, So, it's usable, but for a definitive result I suggest to modify parameters in case of Blazor, for both |
I've got a PR in #531 to expose all the other compile time properties |
This pr does not fix the issue when dealing with Blazor wasm projects debugging via Visual Studio (that use the second project for hosting via ASP.NET Core). To recreate the issue, you can create a new Blazor webassembly project, select ASP.NET Core hosted in the options when creating the new project and in the new solution there will be 3 project (Client, Server, Shared). Set the Server project up normally using ElectronNet.Api and electronize init/start. Running it you'll see the issue. If I remember correctly the publishreadytorun and publishsinglefile both need to be false in this case and I'm not sure where to set that so that when the debugging is started via Visual Studio that they would get passed. If there is a way to set that, then the pr might work. |
I encountered the same issue. |
Has anyone been able to get the "start" command to work? Is there some combination of flags that can be used as a workaround? |
As a workaround, I had in mind building the Blazor WebAssembly app independently and just including the published outputs with the electronized server app. Would that be possible? |
Hi all, I just decided to try testing blazor in electron and see this same problem. |
Hi Guys, in order to debug, just run from your electronized project in a CMD or powershell: alternative: Happy debugging |
@cristiangiagante I still get this error when following your directions. In PowerShell I'm executing this command. electronize start /PublishSingleFile false error NETSDK1102: Optimizing assemblies for size is not supported for the selected publish configuration. Please ensure that you are publishing a self-contained app. |
What is your issue when you try to run it normally? pls share your results |
Let start using a stable release, update your project to target Net5 instead of net6 preview |
I'm facing the same issue, just created a blazor web assembly with asp.net backed and added the elctronNet and facing the same issue |
ok, I will take a look later but seems to be you are currently using the sdk/6.0.100-preview |
Oh, I see what you're saying now. I switched from using the VS2019 Preview to the most recent stable version of VS. How do I get it to use the Net5 SDK? This line here might be part of the problem. |
@cristiangiagante I am using sdk 5.0, I can create a new repo so you can try it out |
I'll figure out how to make mine use SDK 5.0. Maybe that will help me. |
https://github.com/mhamri/ElectronNet-blazor-bug I have v5.0.2 sdk installed on my laptop |
Based on the StartElectronCommand class from electronnet
It should not be using --no-self-contained in the build process, do you have the last version of electronnet? |
as a workaround I created a blazor server side (instead of webassembly with backed asp.net) and everything bundled just fine |
Sorry I totally forgot this, I checked your repo, I was not able to do it work but I know how to do it. You need to create your own NuGet package based on a fork of electronnet and replace the --no-self-contained in the build commands class. |
but do you fix it for later version? |
I don't think so this is not my project, I can't update the official nuget repository |
oh, thankx for the help anyway |
I'm unsure if this'll help anyone... but it seems as-if you execute your blazor app using the following command, it fires as you'd expect it to:
For reference, I'm running this in my solution root folder, and I have all my "source" and "test" projects in dedicated folders. |
🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉 With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun! |
Somehow I have the same problem with a brand new .net8 Blazor app that has Client assembly. Fresh install of Electron.NET CLI and So, in launchSettings.json
it tries to publish with
it tries to publish with
it fails to pack the client project with What am I still missing here? |
The error is:
Full console text:
The text was updated successfully, but these errors were encountered: