I have a .NET Framework 4.6 WPF application. The problem is that if I start the application on Windows 7 with .NET Framework < 4.6 I get a pretty generic crash message that the application has stopped working.
Is there a way to prevent the application from starting if the required .NET version is not installed and instead display a more meaningful message stating that the application requires a certain .NET version to run?
My app.config file:
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
</startup>
</configuration>
It seems that the sku
attribute is ignored and windows tries to start the application using the latest version of the .NET Framework that is present on the user's computer.
The application is deployed as a single file application with no installer, thus I cannot create a separate bootstrapper application that would check .NET version.