none
Going from .NET 2 (VS2005) to .NET 4 (VS2010)

    Question

  • Hello.  Let me start off by saying that if this is the wrong forum to post the following question(s), I apologize.  I wasn't sure.

    Anyway, my question(s) revolve around moving our .NET 2 applications to .NET 4.  Currently, we have multiple applications/assemblies written to target .NET 2 (using VS2005).  We have Windows forms apps, services, ASP.NET apps, and components.  These apps have been around and working on multiple customer servers for a number of years now.

    We now would like to migrate all our .NET 2/VS2005 solutions to .NET 4/VS2010.  This is easy enough by just opening the VS2005 solution in VS2010 and letting it convert the project, but what we're worried about is supporting our existing customers who have the .NET 2 version of the apps.

    Are we to force each and every customer to install .NET 4 to be able to get our updated apps?

    Is there a way to continue supporting the .NET 2/VS2005 apps and have .NET 4/VS2010 apps without having separate projects and duplicate code?

    How are others making or have made this transition?

    Any thing else I'm not thinking of now?

     

    Thanks!

     

    Thursday, January 27, 2011 4:52 PM

Answers

  • You really need to make a decision.

     

    You can migrate all of these projects/solutions to Visual Studio 2010, but still target the .NET 2.  This will allow you to use the newer version of Visual Studio, but not any new .NET features.

     

    If you want to move to .NET 4, however, your customers will need to install the .NET 4 framework (one time).  This really, in my opinion, isn't a big deal - we just build a nice setup program with a bootstrapper that installs it, and I've never had a complaint about the dependency being there.

     

    There isn't a (clean) way to have a single code base that supports both - and there really isn't any reason to do so.  You can always use a .NET2 assembly in a .NET 4 application.  Trying to build both from one codebase prevents you from using new .NET 4 features - so you might as well stick with .NET 2.

     

     


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    • Proposed as answer by Fábio Franco Thursday, January 27, 2011 9:40 PM
    • Marked as answer by lmttag Friday, January 28, 2011 8:18 PM
    Thursday, January 27, 2011 5:06 PM
    Moderator

All replies

  • You really need to make a decision.

     

    You can migrate all of these projects/solutions to Visual Studio 2010, but still target the .NET 2.  This will allow you to use the newer version of Visual Studio, but not any new .NET features.

     

    If you want to move to .NET 4, however, your customers will need to install the .NET 4 framework (one time).  This really, in my opinion, isn't a big deal - we just build a nice setup program with a bootstrapper that installs it, and I've never had a complaint about the dependency being there.

     

    There isn't a (clean) way to have a single code base that supports both - and there really isn't any reason to do so.  You can always use a .NET2 assembly in a .NET 4 application.  Trying to build both from one codebase prevents you from using new .NET 4 features - so you might as well stick with .NET 2.

     

     


    Reed Copsey, Jr. - http://reedcopsey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    • Proposed as answer by Fábio Franco Thursday, January 27, 2011 9:40 PM
    • Marked as answer by lmttag Friday, January 28, 2011 8:18 PM
    Thursday, January 27, 2011 5:06 PM
    Moderator
  • Thanks Reed!  That is helpful information.

    Friday, January 28, 2011 8:18 PM
  • There is nothing wrong with having .Net 2 apps and .Net 4 apps. If the company isn't using features of .Net 4 or modifying the code, why move them to .Net 4. IMHO (Although I am never a big fan of coding to older versions of anything, but if you have a large set of programs...sometimes the effort to move may not pay off). Your call...
    William Wegerson (www.OmegaCoder.Com)
    Friday, January 28, 2011 9:10 PM
    Moderator