Main menu

Fix: .Net 2.0 or 3.5 Setup Project Requires .Net Framework version 4.0

Sorry again folks again I was MIA with loads and loads of work. trust me i have more than 30 drafts which i started and never got time to finish. anyway coming to the point this morning i was trying to deploy a windows service project using the setup project templates in visual studio 2010, and when i tried to install it on client machine i got the following message:

The Setup Requires the .Net Framework version 4.0

But I’m pretty sure that i had the project targeted to .net Framework 3.5 SP1, but still it was  requiring .net 4.0.  as usual i did a Google search and found this article with the trick to resolve it.

actually it was the dependencies in the setup project causing the issue, it was still targetting 4.0 even though my application targets .net 3.5 and by default VS2010 set the dependency to .Net 4.0.

if you have this issue all you have to do is the following :

  1. Double click on the dependencies of the setup project.
  2. Click on the .Net Framework
  3. And you will see the Property window will get enabled.
  4. Change the Version property to your desired .net Framework ( in my case 3.5).
  5. and build your setup again.

That’s it :).

for the original article that gave me this solution visit here.

Just thought i would share this information which that might be helpful for those developers who are in migration process to VS2010 :). hope it help guys!!.



Aneef Fashir (41 Posts)

Software Architect @ Assette, Sri Lanka

  • Me

    I found another spot at least for VS 2008…

    Right Click on your Setup Project and choose Properties
    Click on the Prerequisites button
    Make sure that the correct .Net version is check there as well.

  • Mike

    thanks! your article saved me a bunch of head-scratching

  • Oscar Mederos

    If you are only using features that are included in .NET Framework v2.0, VS2010 does not include .NET Framework 2.0 in the prerrequisites.
    Take a look at the following article in order to solve that problem:

  • Kevin Chen

    thanks, good help.