.net 3.5 application on .net 4.0 runtime

后端 未结 3 1222
广开言路
广开言路 2020-12-17 03:41

If I have an application built to target .net 3.5, will it run if all the user has installed is .net 4.0? A link to official msdn documentation stating this would put my wor

相关标签:
3条回答
  • 2020-12-17 04:07

    MSDN

    This is important:"The .NET Framework 4 is highly compatible with applications that are built with earlier .NET Framework versions, except for some changes that were made to improve security, standards compliance, correctness, reliability, and performance."

    0 讨论(0)
  • 2020-12-17 04:08

    Yes, it can. You can say that you support .NET 4 in your app.config file:

    <configuration>
      <startup>
        <supportedRuntime version="v4.0" /> 
      </startup>
    </configuration>
    

    Note that changes in the framework may break your app. For details, see MSDN's list of .NET 4 migration issues, which includes recommended changes.

    If you still want to support users with only .NET 3.5 installed, you also need to add a <supportedRuntime version="v2.0.50727" /> element:

    <configuration>
      <startup>
        <supportedRuntime version="v4.0" /> 
        <supportedRuntime version="v2.0.50727" /> 
      </startup>
    </configuration>
    

    Note that the above configuration prefers .NET 4.0 if that is installed. Changing the order above makes the application prefer .NET 3.5 if that is installed. A complete table of possible configurations and effects can be found in MSDN's how-to on configuring your app to support .NET 4.0 or 4.5.

    0 讨论(0)
  • 2020-12-17 04:14

    The answer is most probably, and here are the MSDN tools to determine if your app will have issues.

    http://msdn.microsoft.com/en-us/library/ff602939.aspx

    0 讨论(0)
提交回复
热议问题