Enable App to target .NET 3.5 and .NET 4?

  • Thread starter Thread starter Justin Chalfant
  • Start date Start date
J

Justin Chalfant

Guest
Hi All,



I have a Visual Basic application and i'm using VS 2017. The app was originally created to target .NET Framework 3.5. I would like to allow the app to target .NET 3.5 or/and 4.0/4.5 so it could run on a machine with .NET Framework 3.5 or a machine with just .NET Framework 4.0 or 4.5.



I was reviewing this article: https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-configure-an-app-to-support-net-framework-4-or-4-5 it seems like this should be possible by editing the app.config file. I edited the app.config file and added the following lines to allow multi framework targeting based on the article.



<startup>

<supportedRuntime version="v4.0"/>

<supportedRuntime version="v2.0.50727"/>

</startup>



What happens is the app works on a machine with .NET framework 3.5 installed, but it won’t run on a Windows 10 machine with just .NET Framework 4.5 installed (Exact version installed is: 4.7.02046). I get the prompt you need .NET 3.5 and prompted to download:



Any idea what I may be missing here?


Justin Chalfant | My Blog | LinkedIn | Please mark as helpful/answer if this resolved your post

Continue reading...
 
Back
Top