简体   繁体   中英

NET Framework migration from v3.5 to v4.0

I have a visual studio 2008 solution and .NET Framework v3.5. Recently I have converted into Visual Studio 2010 and .NET Framework v4.0.

To change to .NET Framework v4.0 I have done through project properties and build tab, by changing target to target Framework v4.0 for each project. However if I open configuration project file csproj, I can see there is a tag related to v3.5:

 <ItemGroup>
   <Reference Include="System" />
   <Reference Include="System.Core">
    <RequiredTargetFramework>3.5</RequiredTargetFramework>
   </Reference>
   <Reference Include="System.Data" />
   <Reference Include="System.Drawing" />
   <Reference Include="System.Xml" />
   <Reference Include="WindowsBase">
    <RequiredTargetFramework>3.0</RequiredTargetFramework>
   </Reference>
 </ItemGroup>

I would like to know why for some included references is referring to v3.0, v3.5 frameworks if project targets to .NET Framework v4.0. This also happens for other projects despite project is targeting to NET framework v4.0.

System.Core is targeting to 3.5 WindowsBase is targeting to 3.0

Those references themselves require 3.5 (for System.Core) and 3.0 (for WindowsBase). Actually, this isn't 100% correct (see Ramhound's comment to this answer).

So far, any .NET framework above 2.0 is essentially DLLs that site on top of 2.0. For example, a few years and one job ago, I needed LINQ and Hashset<T> in .NET 2.0, since half my users were stuck on Win2K, which doesn't support anything above .NET 2.0. I wound up recompiling System.Core from Mono and had it target 2.0, and was able to use newer features.

I don't think it's anything you need to worry about.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM