Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NET Framework migration from v3.5 to v4.0

Tags:

c#

frameworks

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

like image 882
Ralph Avatar asked Jan 08 '13 17:01

Ralph


1 Answers

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.

like image 193
Chris Doggett Avatar answered Oct 02 '22 05:10

Chris Doggett