chromelyapps / Chromely

Build Cross Platform HTML Desktop Apps on .NET using native GUI, HTML5, JavaScript, CSS, Owin, AspNetCore (MVC, RazorPages, Blazor)
MIT License
2.98k stars 279 forks source link

PublishSingleFile not working #296

Closed charlie-haley closed 3 years ago

charlie-haley commented 3 years ago

I'm looking to condense the number of output files as much as possible, I'm running this command:

dotnet publish -c Release -p:PublishSingleFile=true -r win-x64

It seems to work as I get quite a large exe (75mb), but when I open it I get an error

CEF binaries download completed with error.
Error message: The remote server returned an error: (403) Forbidden.

Is there a recommend way to compile the app into a single execeutable or as little files as possible?

mattkol commented 3 years ago

@charlie-haley

Is there a recommend way to compile the app into a single execeutable or as little files as possible?

Installation/packing is not supported, so really no formal recommendation on creating single executable.

You maybe doing the packing right, but that may be blocking the download process. If the download works without publishing, I will check first what is causing the download error. There should be a "Logs" folder in the bin directory that should have logged the details.

charlie-haley commented 3 years ago

@charlie-haley

Is there a recommend way to compile the app into a single execeutable or as little files as possible?

Installation/packing is not supported, so really no formal recommendation on creating single executable.

You maybe doing the packing right, but that may be blocking the download process. If the download works without publishing, I will check first what is causing the download error. There should be a "Logs" folder in the bin directory that should have logged the details.

Is it possible to download the cef binaries at build/publish time so I can bundle them and prevent the download even needing to start?

mattkol commented 3 years ago

@charlie-haley Yes, the guide to download is here - https://github.com/chromelyapps/Chromely/blob/master/Documents/cef_binaries_download.md

If you are doing this on Windows and build using Visual Studio/Visual Studio Code with nuget, it should have downloaded it for you already. You can check the nuget folder ..

image

Check the "CEF" folder.

Alternatively (Windows ONLY) - issue #297

peerem commented 3 years ago

This is actually not a problem. Simply use "PublishSingleFile" and then copy the "Chromely.dll" into the output folder. Works fine.