- 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 ?
-
3Short answer: No. A project targeting .NET Framework version X can reference an assembly that is compiled against any .NET Framework version up until version X.mm8– mm82018-11-05 13:49:57 +00:00Commented Nov 5, 2018 at 13:49
-
1The C# language version number does not matter, its just an information for the compiler how to "understand" what you have written - once your code is compiled the only limit for reference is you can only reference framework version lower or identical to your project.Rand Random– Rand Random2018-11-05 13:55:27 +00:00Commented Nov 5, 2018 at 13:55
-
He obviously want to do it. This question smells X,Y problem. as @mm8 said, it's a short answer to say no. But it is possible to work around and use a higher framework version with lower one. Your question right now simply ask for if it's "directly" possible and that is obviously no.Franck– Franck2018-11-05 13:57:10 +00:00Commented Nov 5, 2018 at 13:57
-
Even if this were possible, the practical result would be that functionality based on higher versions of .NET would not work on systems where that prerequisite was been met.Chiramisu– Chiramisu2021-01-14 05:28:27 +00:00Commented Jan 14, 2021 at 5:28
2 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.