jmalarcon / DotNetVersions

Command line tool that shows the currently installed "classic" .NET versions in your system
https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed
MIT License
449 stars 96 forks source link

.NET Framework compatibility #5

Closed ferenczy closed 2 years ago

ferenczy commented 3 years ago

According to your documentation, DotNetVersions should require .NET Framework 2.0 to be executed. Even though I have the latest .NET Framework 4.8 installed (the Developer Pack edition), when I execute DotNetVersions, it triggers the missing runtime dialog:

Missing runtime dialog

Is it expected? I thought that .NET Framework should be backwards compatible. Do I really need to install .NET Framework 3.5?

ferenczy commented 3 years ago

According to the Microsoft's Version compatibility in .NET Framework document, the .NET Framework should be fully backwards compatible:

The .NET Framework 4.5 and later versions are backward-compatible with apps that were built with earlier versions of the .NET Framework. In other words, apps and components built with previous versions will work without modification on the .NET Framework 4.5 and later versions.

But there's also the following note, which may be the reason why DotNetVersions require older runtime, I guess:

However, by default, apps run on the version of the common language runtime for which they were developed, so you may have to provide a configuration file to enable your app to run on the .NET Framework 4.5 or later versions.

So it should be easily fixable, if I understood it right. Just add recent .NET Framework runtimes as supported runtimes to the app config, so people won't need to install outdated versions.

I'm not sure what's the reason for that, why any app is not automatically able to be executed on a newer runtime.

ferenczy commented 3 years ago

And this is quite funny. I have manually downloaded the .NET Framework 3.5 SP1 runtime, executed the installer and it triggered the same missing runtime dialog. 😁 I guess I'm missing something...

Anyway, I have tried to use the "Download and install this feature" button on the missing runtime dialog and it ended up with this:

Failed installation of .NET Framework 3.5

I don't know what's wrong. I'm using quite vanilla machine, there was no messing with .NET Frameworks, I have just .NET Core 3.1 and Visual Studio installed and today, I have installed the .NET Framework 4.8 (Developer Pack).

So I'm effectively not able to run your app since I'm not able to install the .NET Framework 3.5. ☹

jmalarcon commented 3 years ago

Hi:

Have you tried to run it with the DotNetVersions.exe.config accompanying file that is in the .zip file? That file is needed for it to work with both 2.0 and 4.0 versions of the framework. If you execute the .exe file without it and only have the latest version, if won't work and will show the dialog that you are telling in the issue.

Try this and it will work. Tell me, please...