Results 1 to 8 of 8

Thread: .NET Frameworks Question 2.0, 3.5 and 4.0 when only targeting 4.0 ?

  1. #1
    daveaton is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.0
    Join Date
    Oct 2011
    Posts
    3
    Reputation
    0

    Question .NET Frameworks Question 2.0, 3.5 and 4.0 when only targeting 4.0 ?

    If I have an app that was targeting 4.x framework but used controls that used 3.5 and 2.0 in this same app. Would the user have to have the 3.5 and the 2.0 frameworks installed?

    I want to install my app on windows 2003 with only framework 1.1 pre-installed. I made a installer that installs 4.0 framework. Do I need to make my installer install frameworks 2.0 and 3.5 along with 4.0 ?

    Thanks in advance.

  2. #2
    JuggaloBrotha's Avatar
    JuggaloBrotha is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Jun 2004
    Location
    Lansing, MI; USA
    Posts
    4,464
    Reputation
    1015
    You will need to have your installer check for (and install) all of the needed Frameworks for your application to work. Luckily for you if you have something that targets the 3.5 Framework then you only need to check for the 3.5 Framework even if you also have something depending on the 2.0 Framework. Reason for that is because the 3.5 Framework requires the 3.0 Framework be installed and the 3.0 Framework requires the 2.0 Framework, so just to have the 3.5 FW installed you have to have the other 2 installed as well, which simplifies it for you.
    Currently using: VS 2010 Ultimate on Win7 Ultimate x64.

  3. #3
    daveaton is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.0
    Join Date
    Oct 2011
    Posts
    3
    Reputation
    0

    Question How about for the framework 4.0 ?

    So are you saying that if I targeted the 4.0 frame work I would just need to make sure the 4.0 and 3.5 framework are installed ?

    Thanks in advance.

  4. #4
    JuggaloBrotha's Avatar
    JuggaloBrotha is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Jun 2004
    Location
    Lansing, MI; USA
    Posts
    4,464
    Reputation
    1015
    No, I'm saying that if everything in your app targets just the 4.0 Framework then all you need is the 4.0 Framework as a requirement in the installer. But if your 4.0 FW app uses a dll that targets the 3.5 FW then your installer will need to check for both the 4.0 FW and the 3.5 FW. But if your 4.0 FW app uses a dll that targets the 3.5 FW and another dll that targets the 2.0 FW then all you need your installer to check for is the 4.0 and 3.5 Frameworks, because the 3.5 Framework installer will install the 3.0 Framework and the 3.0 Framework installer will install the 2.0 Framework as needed for you.
    Currently using: VS 2010 Ultimate on Win7 Ultimate x64.

  5. #5
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.5
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    15,080
    Reputation
    2802
    According to this Version Compatibility in the .NET Framework previous .Net version assemblies should work on the .Net 4 runtime.

    Also realize that only one CLR version runs for a given process (application), so when app is compiled for .Net 4 it runs on CLR 4, and all referenced assemblies are also loaded by same CLR 4.

    One more note, referenced assemblies is not covered by the new In-Process Side-by-Side feature of CLR 4 (ref CLR Inside Out: In-Process Side-by-Side).

    Quote Originally Posted by daveaton
    If I have an app that was targeting 4.x framework but used controls that used 3.5 and 2.0 in this same app. Would the user have to have the 3.5 and the 2.0 frameworks installed?
    So the answer is no, you only need .Net 4. But do test that everything works reliably, and if possible rebuild dependencies for the apps current .Net version.

  6. #6
    riham is offline VB.NET Forum Newbie
    .NET Framework
    .NET 3.5
    Join Date
    Dec 2014
    Posts
    1
    Reputation
    0
    That's exactly what happens to me now with the reference 'System.XML.Linq' I need that reference in Framework 2.0, the reason why I need this is just because when my application can't handle an exception automatically trigger an event to send an email with the error's detail but to compose that email I need XML so what can I do?
    Decrease your exam stress by using our latest A00-211 exam and best quality C2010-570 and callutheran.edu . We provide with 100% pass guarantee along with fcc and www.pittstate.edu.

  7. #7
    JohnH's Avatar
    JohnH is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.5
    Join Date
    Dec 2005
    Location
    Norway
    Posts
    15,080
    Reputation
    2802
    Quote Originally Posted by riham View Post
    That's exactly what happens to me now with the reference 'System.XML.Linq' I need that reference in Framework 2.0, the reason why I need this is just because when my application can't handle an exception automatically trigger an event to send an email with the error's detail but to compose that email I need XML so what can I do?
    Linq was new in .Net 3.5, you can't reference that from a .Net 2 assembly. Start a new thread if you need help with send/compose email.

  8. #8
    jmcilhinney's Avatar
    jmcilhinney is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    13,774
    Reputation
    1703
    Quote Originally Posted by riham View Post
    That's exactly what happens to me now with the reference 'System.XML.Linq' I need that reference in Framework 2.0, the reason why I need this is just because when my application can't handle an exception automatically trigger an event to send an email with the error's detail but to compose that email I need XML so what can I do?
    If you need XML then use XML. You don't need LINQ for that.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •