There are some "Hacks" that involve using a System.Core.dll from the 3.5 Framework to make it run with .net 2.0
A small test with Visual Studio 2008 Beta 2 to reproduce:
- Create a new console application
- Keep only System and System.Core as referenced assemblies
- Set Copy Local to true for System.Core, because it does not exist in .NET 2.0
- Use a LINQ query in the Main method, like the one i mentioned below.
- Build
- Copy all the bin output to a machine where only .NET 2.0 is installed
- Run
class Program
{
static void Main(string[] args)
{
var processes =
from process in System.Diagnostics.Process.GetProcesses()
where process.ProcessName.StartsWith("s")
select new {process.Id, Name = process.ProcessName};
foreach (var process in processes)
Console.WriteLine(process);
}
}
.NET 2.0 SP1 is actually required if you want to use LINQ to SQL on .NET 2.0 because it contains an updated version of System.dll!
Why this works?
The .net framework 2.0, 3.0 and 3.5 works on the same clr (2.0), so every assembly can be reference from 2.0 to upper. It would not work with .net 4.0 because it use another clr with things such as dynamic.
Also, remember that you can do the same with Foundations libraries and any other with 3.5.
NOTE: Redistributing System.Core.dll is a violation of Microsoft's license