none
Why does setup install .Net 3.5 SP1 for a .Net 2.0 application? RRS feed

  • Question

  • Title says it all.  I have created a setup project to install a .Net 2.0 application (Windows forms-based, written in C#).  I'm using VS2008.  When I go to install on a Windows XP machine, it requires installation of .Net 3.5 SP1, and will not allow the installation to go forward without it, even though .Net 2.0 SP 2 is already installed.  How can I make the installer just pay attention to .Net 2.0 instead?
    Thursday, July 9, 2009 9:28 PM

Answers

  • You have to target your assembly to .NET 2.0, and not .NET 3.5SP1.  VS 2008 uses .NET 3.5SP1 by default.  Double click on the "Properties" folder in your project, and change "Target Assembly" to ".NET Framework 2.0".  Do this for every project in your solution.  Rebuild and reinstall. Note that if you've used .NET 3.5 features, such as the extension methods for LINQ, you'll have to go back and re-code those sections "old style". 

    That being said, it wouldn't hurt to go ahead and install .NET 3.5 SP1 on the target machine.
    David Morton - http://blog.davemorton.net/ - @davidmmorton - ForumsBrowser, a WPF MSDN Forums Client
    • Marked as answer by YiChun Chen Monday, July 13, 2009 8:26 AM
    Friday, July 10, 2009 2:18 PM
  • There's a setting in the setup project. In the Launch Conditions view, right-click the .NET Framework launch condition and see what version you have there - it's probably 3.5.
    Phil Wilson
    • Marked as answer by YiChun Chen Monday, July 13, 2009 8:26 AM
    Friday, July 10, 2009 5:59 PM

All replies

  • You have to target your assembly to .NET 2.0, and not .NET 3.5SP1.  VS 2008 uses .NET 3.5SP1 by default.  Double click on the "Properties" folder in your project, and change "Target Assembly" to ".NET Framework 2.0".  Do this for every project in your solution.  Rebuild and reinstall. Note that if you've used .NET 3.5 features, such as the extension methods for LINQ, you'll have to go back and re-code those sections "old style". 

    That being said, it wouldn't hurt to go ahead and install .NET 3.5 SP1 on the target machine.
    David Morton - http://blog.davemorton.net/ - @davidmmorton - ForumsBrowser, a WPF MSDN Forums Client
    • Marked as answer by YiChun Chen Monday, July 13, 2009 8:26 AM
    Friday, July 10, 2009 2:18 PM
  • There's a setting in the setup project. In the Launch Conditions view, right-click the .NET Framework launch condition and see what version you have there - it's probably 3.5.
    Phil Wilson
    • Marked as answer by YiChun Chen Monday, July 13, 2009 8:26 AM
    Friday, July 10, 2009 5:59 PM
  • Hi Vanceg,

    As David and Phil mentioned, please check the target framework of your application (.NET Framework 2.0 instead of .NET Framework 3.5) and Launch condition of the deployment.

    Moreover, please check the property of setup project. Right click on the setup project >> Click "Prerequisite..." >> Check ".NET Framework 3.5 SP1" is not selected.

    Thanks
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, July 13, 2009 8:33 AM
  • There's a setting in the setup project. In the Launch Conditions view, right-click the .NET Framework launch condition and see what version you have there - it's probably 3.5.
    Phil Wilson

    Thanks a lot Phil, good catch, worked for me like a charm after several checks, rebuilds and deploys ... I was totally confused since all the projects were targeting .Net 2.0. ... 

    Best regards,
    Vladimir

     

    Friday, December 10, 2010 2:36 AM