Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using different versions c# and .NET Framework with dll [duplicate]

Tags:

c#

.net

  • A project with C# 3.0 and .NET Framework 3.5 can use a dll with the most recent version of C# and .NET Framework ?
  • A project with C# 3.0 can use a dll with the most recent version of C# but similar .NET Framework version ?

  • A project with .NET Framework 3.5 can use a dll with the most recent version of .NET Framework but similar C# version ?

like image 478
Rod Avatar asked Nov 05 '18 13:11

Rod


1 Answers

A project with C# 3.0 and .NET Framework 3.5 can use a dll with the most recent version of C# and .NET Framework ?

Short answer: No. A project targeting .NET Framework version 3.5 can reference an assembly that is compiled against any .NET Framework version up until version 3.5.

A project with C# 3.0 can use a dll with the most recent version of C# but similar .NET Framework version ?

Yes. The version of the programming language is only important at compile time. At runtime, it doesn't matter which version of C# the assmebly was implemented with.

A project with .NET Framework 3.5 can use a dll with the most recent version of .NET Framework but similar C# version ?

No. An assembly built against .NET Framework 3.5 can only reference assemblies built against .NET Framework 3.5 or earlier.

like image 53
mm8 Avatar answered Nov 15 '22 01:11

mm8