runtime: .NET Core runtime for Desktop does not include the actual runtime and it doesn't block or prompt for it
- Created a plain .NET Core 3.0 WPF project
- Rebuild in release mode
- Copied the files in the release folder to a new computer which is missing .NET Core at all

- Visited https://dotnet.microsoft.com/download on this computer and downloaded the
Download .NET Core Runtime for desktop appsand installed it - Tried to start the program, nothing happens.
The event viewer says:
Description: A .NET Core application failed.
Application: WpfApp12.exe
Path: C:\Users\TestAccount\Desktop\WpfApp12.exe
Message: A fatal error occurred. The required library hostfxr.dll could not be found.
If this is a self-contained application, that library should exist in [C:\Users\TestAccount\Desktop\].
If this is a framework-dependent application, install the runtime in the global location [C:\Program Files\dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x64\InstallLocation].
//edit: dotnet publish creates >290 files even when not self contained with an overall size of 150mb. My thought was that installing the runtime would install these >290 files and avoid having me to ship a 150mb application. Similar to .NET Framework. If that’s not the case then: What exactly is the runtime installer for? And whats the purpose of self-contained when even the not self-contained application would force me to ship >290 files and >150mb?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 22 (13 by maintainers)
It’s even more confusing because these two look like equivalent things, but if I understand correctly, one of them has the core runtime and the other does not:
@Symbai if you want to a place to send end users of your application, then we also added https://dotnet.microsoft.com/download/dotnet-core/3.0/runtime/desktop, which is trimmed down to just the desktop runtime info.
There is a separate change underway to have a prompt to download the correct runtime built into .NET Core itself - https://github.com/dotnet/core-setup/pull/8509. It will also send folks to the page I mentioned above.
I realized that while the x86/x64 combination is difficult, we can make significant incremental progress by still producing separate x64 and x86 WindowsDesktop bundles, but having them include the .NET Core Runtime. This is significantly simpler to implement. I’ve filed https://github.com/dotnet/core-setup/issues/8504 for this specifically.
@dagood I was confused by this also – I read the download page carefully, but the message you mention is on the page that appears while the download occurs, and it’s done so quickly that I was already not reading the web page at that point. Maybe it could go onto https://dotnet.microsoft.com/download as well. Or better still, the installer would block installation if its dependency was not present. (As alternatives to what you mention, having a combined installer)
@dagood Thanks this explains the issue, although the notice is not visible for me (might be browser setting, who knows). Sadly the choice of two installers wasn’t a good idea. It means there are two dependencies now? Why? Why can’t Desktop Runtime contain the .NET Core Runtime or vice versa (for Windows only)? Having two installers causes a lot of support issues for developers dealing with inquiries why the app doesn’t start. It makes things more complicated than it should be.
The windows runtime installer should contain everything needed in order to run a windows .NET Core app whether its a console or WPF / Winforms app. Which strong argument exist that it has to be separated? I could fairly accept to have a .NET Core runtime standalone but the runtime for Desktop Apps alias WPF / Winforms should really contain everything it needs in order to run WPF / Winforms.
Didn’t know specifying a runtime generates a self contained app thought it must use -self-contained parameter but this is likely documented as well and I just missed that. I guess this part can be ignored then.
FYI updates to the website are now live. We’ve simplified back to a single “Run apps” button on the main download page. This button takes you to a new runtime page that does a better job of differentiating desktop/server apps and has more info to help folks get the right stuff for desktop.
@Symbai Thank you for your input on this. We are just getting our heads around how people want to deploy their desktop applications. And as mentioned, we are in a broader process with the installers.
@dagood can you confirm that there is non-trivial effort in creating a combined runtime/desktop single install that would be hard to accomplish for 3.1.
I propose the following, on Windows only:
If you’d like to test your installation - use
dotnet --list-runtimesat a command prompt.No, I don’t think anyone had that problem in the end, I think we’re just not accustomed to paying attention to “thank you” pages.
(By the way, I filed https://github.com/dotnet/core-sdk/issues/5019 to track this scenario in the fancy new installer I mentioned, and filed https://github.com/dotnet/core-setup/issues/8379 for @danmosemsft’s idea of having the installer detect its dependency as a mitigation.)
I do think it makes sense to consider as another mitigation a page/set of pages dedicated to WPF/WinForms app users. Seems like a reasonable way to deliver more info but without adding it to any main pages. (I’m not too familiar with the constraints of the site design, however.)
This is a significant problem, we’re relying on this message while the installer’s in its current state. 😕 To be clear, when you go to https://dotnet.microsoft.com/download/thank-you/dotnet-runtime-3.0.0-windows-x64-desktop-runtime-installer (and cancel the download), you don’t see the box above
If your download doesn't start after 30 seconds[...]?/cc @leecow
It wasn’t so much a choice. I wholeheartedly agree we aren’t in an ideal state. I had time to implement the current installer, such as it is, but didn’t have time to implement an installer that bundled everything together. (It requires significantly more infrastructure work.) We have some larger installer plans that will hopefully end up improving this in 3.1, see https://github.com/dotnet/core-sdk/issues/5019.
I think the evolution of these SDK args over time may be why it’s somewhat confusing. https://docs.microsoft.com/en-us/dotnet/core/deploying/deploy-with-cli has some details on the CLI args and which modes you end up with. Skimming through, I don’t see detail on what happens when
--self-containedisn’t specified at all, but hopefully that page is still useful.Did you also install the .NET Core Runtime? Missing it would explain hostfxr not existing and nothing happening. This message on the Desktop Runtime download page is meant to point to it:
https://github.com/dotnet/core-setup/issues/8363 is an earlier issue about this.
We also have https://github.com/dotnet/core-setup/issues/8222 tracking the poor experience (nothing happening!) when hitting this situation.
I’m not able to repro this, after
dotnet new wpfdotnet publishI only get:Are you sure you didn’t specify a runtime, like
dotnet publish -r win-x64? That generates a self-contained app, where the large number of files is expected.