none
Compatibility in dot net framework RRS feed

  • Question

  • Here is some compatibility related doubts in dot net framework.

    An application developed in dot net framework 2.0. But the deployment machine contains only 3.5 framework version or higher vesrion.

    Can I deploy apps in that machine ?

    In client machine which edition of the frame work will install ? redistributable pack or sdk ?

    Friday, July 27, 2012 7:30 AM

Answers

  • .NET framework class libraries are backward compatible. This means you can run your application developed in 2.0 in 3.5 framework. By default, an application runs on the version of the .NET Framework that it was built for. If that version is not present and the application configuration file does not define supported versions, a .NET Framework initialization error may occur. In this case, the attempt to run the application will fail.

    Read more about compatibility related concerns and practices here

    Link 1

    Link 2

    Link 3


    If this post answers your question, please click Mark As Answer. If this post is helpful please click Mark as Helpful.

    Regards,
    Nair S

    • Marked as answer by ssa2010 Saturday, July 28, 2012 4:54 AM
    • Unmarked as answer by ssa2010 Saturday, July 28, 2012 8:24 AM
    • Marked as answer by ssa2010 Monday, July 30, 2012 8:24 AM
    Friday, July 27, 2012 8:38 AM
  • .NET 3.5 are still using the .NET 2.0 runtime. If you have .NET 3.5 you also have .NET 2.0 and 3.0.
    • Proposed as answer by pvdg42 Friday, July 27, 2012 7:08 PM
    • Unproposed as answer by ssa2010 Monday, July 30, 2012 8:24 AM
    • Marked as answer by ssa2010 Monday, July 30, 2012 8:24 AM
    Friday, July 27, 2012 11:08 AM
    Moderator
  • Hi ssa2010,

    Thanks for your post.

    When referring to the third link, you will see this info:

    Note: The .NET Framework version 3.0 and 3.5 use version 2.0.50727 of the CLR.

    As MCC mentioned ".NET 3.5 are still using the .NET 2.0 runtime. If you have .NET 3.5 you also have .NET 2.0 and 3.0."

    So please modify your code of <supportedRuntime version="v3.5"/>

    To <supportedRuntime version="v2.0.50727">

    Additionally, in my mind, just keep your application "target to .NET 2.0" is OK.

    If you have .NET 3.5 on your OS, you also have .NET 2.0 and .NET 3.0 too.

    Regards,


    Barry Wang [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by ssa2010 Monday, July 30, 2012 8:24 AM
    Monday, July 30, 2012 2:56 AM
    Moderator
  • Please see my earlier post

    I follow that third link of framework version 2.0 (http://msdn.microsoft.com/en-us/library/w4atty68%28v=vs.80%29.aspx)

         <startup>
          <supportedRuntime version="v3.5"/>
        </startup>

    Add the above code in a app.config file of vb.net 2005 windows application.

    But an error occured.

    "The operation could not be completed. Unspecified error"

    Please explain what is the problem ?

    Note this line in http://msdn.microsoft.com/en-us/library/w4atty68(v=vs.100).aspx you have to use 2.0.50727 of CLR for .NET 2.0/3.0/3.5.

    The .NET Framework version 3.0 and 3.5 use version 2.0.50727 of the CLR.

    • Marked as answer by ssa2010 Monday, July 30, 2012 8:23 AM
    Monday, July 30, 2012 7:47 AM

All replies

  • .NET framework class libraries are backward compatible. This means you can run your application developed in 2.0 in 3.5 framework. By default, an application runs on the version of the .NET Framework that it was built for. If that version is not present and the application configuration file does not define supported versions, a .NET Framework initialization error may occur. In this case, the attempt to run the application will fail.

    Read more about compatibility related concerns and practices here

    Link 1

    Link 2

    Link 3


    If this post answers your question, please click Mark As Answer. If this post is helpful please click Mark as Helpful.

    Regards,
    Nair S

    • Marked as answer by ssa2010 Saturday, July 28, 2012 4:54 AM
    • Unmarked as answer by ssa2010 Saturday, July 28, 2012 8:24 AM
    • Marked as answer by ssa2010 Monday, July 30, 2012 8:24 AM
    Friday, July 27, 2012 8:38 AM
  • .NET 3.5 are still using the .NET 2.0 runtime. If you have .NET 3.5 you also have .NET 2.0 and 3.0.
    • Proposed as answer by pvdg42 Friday, July 27, 2012 7:08 PM
    • Unproposed as answer by ssa2010 Monday, July 30, 2012 8:24 AM
    • Marked as answer by ssa2010 Monday, July 30, 2012 8:24 AM
    Friday, July 27, 2012 11:08 AM
    Moderator
  • Hi Nair S


    >> Read more about compatibility related concerns and practices here

    >> Link 1

    >> Link 2

    >> Link 3

    I follow that third link of framework version 2.0 (http://msdn.microsoft.com/en-us/library/w4atty68%28v=vs.80%29.aspx)

         <startup>
          <supportedRuntime version="v3.5"/>
        </startup>

    Add the above code in a app.config file of vb.net 2005 windows application.

    But an error occured.

    "The operation could not be completed. Unspecified error"

    Please explain what is the problem ?

    Saturday, July 28, 2012 8:12 AM
  • Hi ssa2010,

    Thanks for your post.

    When referring to the third link, you will see this info:

    Note: The .NET Framework version 3.0 and 3.5 use version 2.0.50727 of the CLR.

    As MCC mentioned ".NET 3.5 are still using the .NET 2.0 runtime. If you have .NET 3.5 you also have .NET 2.0 and 3.0."

    So please modify your code of <supportedRuntime version="v3.5"/>

    To <supportedRuntime version="v2.0.50727">

    Additionally, in my mind, just keep your application "target to .NET 2.0" is OK.

    If you have .NET 3.5 on your OS, you also have .NET 2.0 and .NET 3.0 too.

    Regards,


    Barry Wang [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by ssa2010 Monday, July 30, 2012 8:24 AM
    Monday, July 30, 2012 2:56 AM
    Moderator
  • >> So please modify your code of <supportedRuntime version="v3.5"/> To <supportedRuntime version="v2.0.50727">

    But the testing application is vb.net 2005 windows application. So application is work when I add or remove this code.  

    Monday, July 30, 2012 3:36 AM
  • Hello,

    As far as I see, new versions .NET frameworks are fully backwards compatible to older versions. So you just target your app to .NET 2.0 and it will work on .NET 3.5. And if you have problems with deploying projects, a ClickOnce forum will be better for you:http://social.msdn.microsoft.com/Forums/en-US/winformssetup/threads


    Monday, July 30, 2012 4:50 AM
  • Hi ssa2010,

    Let's clarify your question first
    "An application developed in dot net framework 2.0. But the deployment machine contains only 3.5 framework version or higher vesrion. Can I deploy apps in that machine ?"

    When referring to this page of .NET 3.5 download page http://www.microsoft.com/en-us/download/details.aspx?id=21

    You will see the following comments

    "Microsoft .NET Framework 3.5 contains many new features building incrementally upon .NET Framework 2.0 and 3.0, and includes .NET Framework 2.0 service pack 1 and .NET Framework 3.0 service pack 1."

    It means the target machine already has .NET 2.0 SP1, .NET 3.0 SP1, .NET 3.5.

    So in my mind if you want to deploy your application to that machine.  You don't need to add any .NET package.

    Additionally, since you want to deploy apps on other machines.

    I agree with Edward, you can post your question to  http://social.msdn.microsoft.com/Forums/en-US/winformssetup/threads

    You can get better support there.

    Regards,


    Barry Wang [MSFT]
    MSDN Community Support | Feedback to us

    Monday, July 30, 2012 5:11 AM
    Moderator
  • Please see my earlier post

    I follow that third link of framework version 2.0 (http://msdn.microsoft.com/en-us/library/w4atty68%28v=vs.80%29.aspx)

         <startup>
          <supportedRuntime version="v3.5"/>
        </startup>

    Add the above code in a app.config file of vb.net 2005 windows application.

    But an error occured.

    "The operation could not be completed. Unspecified error"

    Please explain what is the problem ?

    Monday, July 30, 2012 7:36 AM
  • Please see my earlier post

    I follow that third link of framework version 2.0 (http://msdn.microsoft.com/en-us/library/w4atty68%28v=vs.80%29.aspx)

         <startup>
          <supportedRuntime version="v3.5"/>
        </startup>

    Add the above code in a app.config file of vb.net 2005 windows application.

    But an error occured.

    "The operation could not be completed. Unspecified error"

    Please explain what is the problem ?

    Note this line in http://msdn.microsoft.com/en-us/library/w4atty68(v=vs.100).aspx you have to use 2.0.50727 of CLR for .NET 2.0/3.0/3.5.

    The .NET Framework version 3.0 and 3.5 use version 2.0.50727 of the CLR.

    • Marked as answer by ssa2010 Monday, July 30, 2012 8:23 AM
    Monday, July 30, 2012 7:47 AM
  • Can you brief me precisley when you get this "The operation could not be completed. Unspecified error" exception. If it while compiling/building/or while changing any project setup. As you know, it advisable to check the project configuration to see target framework along with whether or not build is enabled.

    If this post answers your question, please click Mark As Answer. If this post is helpful please click Mark as Helpful.

    Regards,
    Nair S

    Monday, July 30, 2012 8:22 AM
  • Yes I found solution in that link

    Now I know why this error happened.

    Thanks for all members


    my second qn is pending

    >> In client machine which edition of the frame work will install ? redistributable pack or sdk ?

    • Edited by ssa2010 Monday, July 30, 2012 8:27 AM
    Monday, July 30, 2012 8:22 AM
  • Yes I found solution in that link

    Now I know why this error happened.

    Thanks for all members


    my second qn is pending

    >> In client machine which edition of the frame work will install ? redistributable pack or sdk ?

    It depends on which version of .NET framework your app targeted. For example, you application targets .NET 2.0 then client machine will request .NET or higher version of .NET framework. However, if you deploy this project and required .NET haven't been installed, application setup will download and install it.  Try this forum for this issue:http://social.msdn.microsoft.com/Forums/en-US/winformssetup/threads

    Cheers!

    Monday, July 30, 2012 9:06 AM
  • ok, discuss the matter in that forum
    Monday, July 30, 2012 11:36 AM