LINQ on the.NET 2.0 Runtime
Can a LINQ made it possible for application work on an equipment that just has the.NET 2.0 runtime mounted?
Theoretically, LINQ is absolutely nothing greater than syntactic sugar, and also the resulting IL code need to look the like it would certainly have in.NET 2.0.
Just how can I write LINQ without making use of the.NET 3.5 collections? Will it run on.NET 2.0?
No, due to the fact that while you assumed LINQ is actually simply syntactic sugar, it in fact greatly made use of expression trees - - an attribute lacking in.NET 2.0.
That being said.NET 3.5 just accumulates ahead of.NET 2.0, which's the reason that the IL does not look "various" or "unique".
I do not see a reason that you should not simply install the.NET 3.5 Framework. Everything.NET 2.0 will certainly function great on it, assure :)
In concept of course, given you disperse the LINQ details settings up and also any kind of dependences. Nonetheless that remains in offense of Microsoft's licensing. Scott Hanselman created a post concerning Deploying ASP.NET MVC on ASP.NET 2.0 which resembles what you are intending to do.
As much as I recognize the LINQ collection is just readily available given that the structure 3.0. If you intend to make use of something comparable in the structure 2.0, you would certainly require to rewritte it on your own :) or locate a comparable 3rd - event collection. I just located a little details here yet it really did not persuaded me either.
There are some "Hacks" that entail making use of a System.Core.dll from the 3.5 Framework to make it run with.net 2.0, yet directly I would certainly not desire usage such a rather unsteady structure.
See below : LINQ support on .NET 2.0
- Create a new console application
- Keep just System and also System.Core as referenced settings up
- Set Copy Local to real for System.Core, due to the fact that it does not exist in.NET 2.0
- Use a LINQ question generally method. As an example the one listed below.
- Copy all the container result to an equipment where only.NET 2.0 is mounted
(Requires.net 2.0 SP1 and also I have no suggestion if packing the System.Core.dll goes against the EULA)