Microsoft .NET compatibility

前端 未结 6 2159
误落风尘
误落风尘 2020-12-20 15:43

I used VS2010, and target for .Net 2.0 (VB.Net Windows Form application)

How to decide what is the .Net target I decided on 2.0 because I understood it will be OK if

相关标签:
6条回答
  • 2020-12-20 16:17

    You have two choices:

    • Recommend your clients install .NET 3.5 SP1 (nobody installs .NET 2.0 anymore)
    • Target .NET 4.0 and ask your clients to install .NET 4.0 (this might not be accepted very well especially if your clients are some large corporations where company policy doesn't allow it)
    0 讨论(0)
  • 2020-12-20 16:20

    Just because you installed .NET 4.0 doesn't mean your application was targeting .NET 4.0.

    If you modify your project settings in Visual Studio to build to target .NET 4.0 and you should no longer get the error (but then your clients will need to install the .NET 4.0 Runtime).

    Personally, if you want to release something that is going to run on the majority of client machines already out there, I would target .NET 3.5. Most people are going to have the runtime installed already.

    If not, it's easy enough to download from Microsoft.

    .

    0 讨论(0)
  • 2020-12-20 16:21

    Here's a brief overview of which framework is required on select windows OSes [which in my opinion are more commonly encountered].

    • XP: 2.0, 3.0, 3.5, 4.0
    • Vista: 3.5, 4.0
    • Win7: 4.0

    As you can see, Microsoft has the frameworks that were already released as of when an OS was being released preinstalled.

    It is also worth noting that when you install .NET 3.5 sp1, you automatically get 3.0 and 2.0 installed. This is because they all run on the same underlying framework and each version builds on the previous.

    .NET 4 is a completely different animal. It runs on a different underlying framework so you don't automatically get the older versions of the .NET framework when you install it.

    Hope this helps.

    0 讨论(0)
  • 2020-12-20 16:37

    The moment is build the project, try to access its properties and change the "Target Framework". And select the framework that your clients have. This may solve your problem.

    0 讨论(0)
  • 2020-12-20 16:39

    A .NET 2.0 application needs .NET 2.0 to run. A .NET 3.0 or 3.5 application only needs .NET 2.0 plus whatever additional .NEt 3.0/3.5 assemblies it actually uses.

    A .NET 4.0 application needs the .NET 4.0 CLR, so .NET 4.0 must be installed.

    0 讨论(0)
  • 2020-12-20 16:40

    You should build an installer (a Setup/Deployment project in Visual Studio) that includes the 2.0 redistributable so that when your clients install your software it will install the necessary .net framework for it to run.

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