Replies: 4 comments
-
https://github.com/dotnet/designs/blob/main/accepted/2020/single-file/design.md#optional-settings shows ways to include other files in single file publish. Untested but But you spoke about publishing WPF. WPF has ALWAYS other files when published singlefile. At least in >=.NET 5. In your case I would just include the fixed distribution as a folder next to your executable. Or getting rid of the single file at all, because nobody likes a >200mb single file. If you just want to get rid of the file clutter there are other ways. |
Beta Was this translation helpful? Give feedback.
-
Do I really have to distribute all 300MB of the fixed version runtime folder with my less than 20MB application? |
Beta Was this translation helpful? Give feedback.
-
Tend to agree with @Symbai re: the fascination with a single file. Does that really matter whether you distribute a bunch of files in a folder or a single humongous file that's roughly the same size? But I totally agree on the runtime size. The Fixed version size is prohibitive especially in comparison to relatively small .NET applications. There's gotta be a better way to do this by relying on the majority of the installed browser and shipping just the WebView interface layer (which presumably is much smaller). See my feature request in #1141 - not sure if that's possible, but would seem like a better distribution strategy. |
Beta Was this translation helpful? Give feedback.
-
I doubt that. If its a WPF application the smallest size you can get when published single file + self contained is somewhere between 80-100mb (with trimming enabled). Otherwise its 190mb. However the short answer is still: Yes. If you dont want that, use the small and tiny webview2 runtime installer and provide that next to your executable. Or include that and check for it on start and when runtime is missing extract it and install it, see my comment in RickStrahl's issue. But that's not what you originally have asked for. |
Beta Was this translation helpful? Give feedback.
-
I would like to create a simple WPF exe that contains a WebView2 control. The app uses self-contained and single file deployment so it can be copied to any windows machine as a single file and without any installation requirements.
Now this WPF app is supposed to display a website (hosted locally by the app itself that is also a ASP.NET Core webserver) using WebView2.
Does WebView2 support this somehow? I know I will probably have to use the Fixed Version distribution mode of the WebView2 runtime to fulfil the requirement that no installation of anything is needed. But how do I fulfil the single file requirement?
The docs state I should
The unpacked
Microsoft.WebView2.FixedVersionRuntime.89.0.774.63.x64.cab
consists of 300MB and 173 files! Do I need to include all of that in to my simple little exe? And how would I include it? Can I embed everything as resource into the exe and then unpack it on first run, or is there a better way?Beta Was this translation helpful? Give feedback.
All reactions