dotnet / core

.NET news, announcements, release notes, and more!
https://dot.net
MIT License
20.95k stars 4.91k forks source link

Please consider updating the .NET missing error prompt to include the version needed #6083

Closed mburbea closed 8 months ago

mburbea commented 3 years ago

Description

I have been testing updating a wpf application from framework to .NET 5, mainly as an experiment to see what would be better, and also because .net is now on MU. I sent this out to a few less tech savvy testers, who were greeted by a prompt that says:

To run this application you must install .NET. Would you like to download it now?

This prompt lead to confusion as they thought they already had .net. I think at minimum the version should be mentioned that the minimum required version the user needs to install. (e.g. you must install .NET 5+)

Another note: If they click the download link they are brought to this page: https://dotnet.microsoft.com/download/dotnet/5.0/runtime

I don't think that page is bad per se, but the first available link is to download the preview version. The link that a desktop user wants is near the bottom left. I think the layout should probably a bit more optimized so that the links a user probably wants is near the top and center.

mairaw commented 3 years ago

Thanks for the feedback @mburbea. @richlander and I were discussing last week about the design of the https://dotnet.microsoft.com/download/dotnet/5.0/runtime page. When we know what download the user needs, we should display only that specific download first.

Related internal issue: https://github.com/dotnet/website/issues/2798

So the prompt didn't show the version like this? image

mburbea commented 3 years ago

Attach43992_20210321_204819

This is what the prompt showed the user. Sorry, I don't have a higher quality image. I don't have access to a PC without .net.

mairaw commented 3 years ago

That's a good repro. Thanks @mburbea.

mairaw commented 3 years ago

@richlander is there something we can improve in the experience? There's no version indicator on this dialog.

richlander commented 3 years ago

That looks like a .NET Framework dialog. It looks like this app. https://github.com/mburbea/koar-item-editor/releases/tag/v2.1.189.

I'll find a machine without .NET Framework 4.8 to test this.

mburbea commented 3 years ago

This is indeed the application in question, however the release that was used for testing came from my .net 5 branch. https://github.com/mburbea/koar-item-editor/pull/93

The prompt does indeed come up and give you the version if you have .net core installed, but if you never installed .net core or .net 5/6, it just says you need .net.

Unfortunately, due to some personal life events, I have not had the time needed to finish the update to .net 5. My azure devops doesn't have a recent artifact, and I can't seem to find the artifact I sent the testers via discord. I can try to get a build tomorrow if this can be helpful in testing.

richlander commented 3 years ago

I just built your branch. Took like <10s. I just need a machine with no .NET 5 on it to test.

richlander commented 3 years ago

OK. I see now. When no runtime is installed at all, you get that screen you displayed above. I understand why. There isn't much logic in the apphost. It's all in a binary that ships with the runtime, which we don't have in this scenario.

In the case of your app on a machine with no runtime, the following link is generated: https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=win10-x64&apphost_version=5.0.5&gui=true

I see that the apphost_version is 5.0.5. I built the app with the .NET 6 Preview 5 SDK. Perhaps there is a way of displaying that version in the dialog.

Thoughts @elinor-fung and @vitek-karas?

vitek-karas commented 3 years ago

There are several existing issues covering this topic: https://github.com/dotnet/runtime/issues/36765 is about the target page the link goes to https://github.com/dotnet/runtime/issues/3811 discusses improvements to the console output in the case of the same error https://github.com/dotnet/runtime/issues/3816 discusses using better UI in this case

The problem with versions is that at the point of failure we don't have the required framework versions for the app. That needs parsing .runtimeconfig.json but that only happens once we find hostfxr which didn't happen yet (there's no hostfxr on the machine). That's why we included the apphost_version in the URL as the best approximation of the required version of the framework. The gui=true can be used to determine that this probably requires WindowsDesktop framework (as the app is marked to run as GUI). There's no indication of ASP.NET requirements, but I can't think of a way to do that right now.

richlander commented 2 years ago

@elinor-fung -- should this specific case be resolved now?

mairaw commented 8 months ago

@elinor-fung can we close this one?

elinor-fung commented 8 months ago

Yes, this can be closed now. The app host version can be found in the details in the dialog - for example: image