C # What happens if I use the code for the .NET 3.5 function on a machine with .Net 2 installed

Just out of interest, if I built some code using the Enumerable.Distinct function that appeared in .Net 3.5 and then ran it on a machine with .Net 2.0, what would happen?

+3
source share
6 answers

The program will crash as soon as the assembly that defines Enumerable.Distinct(System.Core) is required . However, you can make it work if you target .NET 2.0 and use LinqBridge instead of System.Core.

+5
source

3.5 Framework 2.0 Framework, 3.5 Framework. Enumerable.Distinct, 3.5 Framework, .

+3

.Net 2.0 , .

+2

.NET 3.5 - , ,.NET 2.0 + .

, ...NET 3.5 , .

- , , , , , . , , .NET 3.5, .

, , .NET 3.5 (SP1).

+2
source

Most likely, your code will complain that .net 3.5 is not installed at startup.

+1
source

Simple, it will crash at the entrants where you used the specific functions of .net 3.5.

But the main question ... why do you want to do this?

If you migrated a project from .net freamework version 2.0 to 3.5 and don’t use any .net 3.5 function, you cannot imagine a valid frame migration

+1
source

Source: https://habr.com/ru/post/1786342/


All Articles