With a simple, single .exe application, is it possible to target a .NET framework version that is newer than the version installed on the end-user's computer, and somehow notify the end-user when launching the application that he/she needs to install a newer version of .NET in order to use the app?
Under normal circumstances when launching a .NET .exe that was compiled for a newer version of .NET than the version that is currently installed, it seems that sometimes there is a comprehensible message popped up stating that to run the application you must first install version X of the .NET Framework. This is good. However, it doesn't necessarily notify to install the correct/needed version (see screenshot below where it says to install 4.0.30319 even though 4.6 is needed), and other times it seems that the popped message is just a generic CLR error with no explanation that it's due to the wrong version of .NET being installed.
Are there any clever ways to produce/display a consistent/reliable more meaningful or customized message to the end user so that there is never a possibility of him/her just receiving a generic CLR error or a message stating that a version of .NET is needed but it states the wrong version to install?
Windows 2008R2 with .NET 3.5.1 installed when app is targeting .NET 4.6:
Windows 2012R2 with .NET 4.5 installed when app is targeting .NET 4.6: