MikeD
MikeD

Reputation: 973

VS 2010 Setup Project Requires .NET 4.0, but it is already installed

I have a VS 10 project using .Net 4.0 and I use lots of stuff that do require 4.0. I created a VS Setup project added the primary output from my project and built it. I then installed it and everything worked fine. A few days later I am ready to do a new build so I rebuild my project and then the setup project. Now when I run the msi it tells me that .Net Framework 4.0 is required.... I figured I screwed it up so I just create a new setup project, and that works fine. But again a few days later (restarted VS in there probably and maybe even the computer) I rebuild and get the error telling me that .Net 4.0 is required. I did it a few times just to verify and it consistently happens and I cannot figure out why.

The project I am building and installing has a windows service that is set as the startup project. I will switch that to a console app object for local testing purposes and build and test the project (not the setup project). This is the only thing I can think of that may be impacting the build, but again, I cannot figure out why.

Any help is appreciated.

Upvotes: 4

Views: 1358

Answers (1)

Aaron Bennett
Aaron Bennett

Reputation: 3944

This error message is thrown when the Launch Conditions in the Setup Project aren't met.

  • Go to View > Editor > Launch Conditions
  • Change the .Net Framework version value to match the version your setup project is compiled into. By default, the 2010 setup and deployment project condition is set to .NET 4.0 Client Profile.

Upvotes: 1

Related Questions