visual studio installer setup project detecting incorrect version of .net framework as dependency

4.3k views Asked by At

i had created a c# windows forms application targeting .net framework 4.5. then i decided to target .net framework 4 instead; so i also had to reinstall nuget packages, fix some code because of reduced functionality and then clean and rebuild project.

i wanted to create an installer for my application using visual studio 2013 installer setup project, but after i add the files it detects .net framework 4.5 as dependency and not .net framework 4. also when i try to install using the produced installer on another machine it gives the error that .net framework 4.5 is required. no prerequisites are defined in neither the windows forms project nor the setup project.

how can i fix this dependency issue?

2

There are 2 answers

1
raven On BEST ANSWER

what i did to fix this issue:

  1. select View->Editor->Launch Conditions
  2. select .NET Framework then right click and select properties window
  3. change the version by selecting the correct .net framework version from the drop down menu
0
GrixM On

I could not get the accepted answer's solution to work in VS2019, maybe because the menus have changed. So here is what I had to do:

Find in Solution Explorer: Your setup project -> Detected Dependencies folder -> Double-click "Microsoft .NET Framework". The properties pane should appear with the lauch conditions for the .NET Framework, and there is a property for which version of .NET the installer should check for, and its download link. Simply make sure this matches the .NET framework you are building your application with.