tags:

views:

686

answers:

12

Basically what the title says. (Forgive me because I am a .NET newb)

In my department, we have a server running .net 3.5 and ever since I got into this section I have been using LINQ. However, I am starting a personal project on a different server (obviously), so 2 questions:

What do I need to get up and running with LINQ?

What does the server need to run LINQ?

Will .net 2.0 work on the server?

The code behind would be C# if that matters.

Edit: Would I have to compile it in 3.5 or would 2.0 work?

+2  A: 

I'm assuming you're talking about LINQ to SQL specifically.

You would only need v3.5 of the framework installed on your development machine and the server.

The server doesn't run linq; linq will in the end send SQL statements to your server.

The language doesn't matter.

hometoast
A: 

LINQ requires framework 3/3.5, because it use a lot of extensions of 3/3.5 (Extension method, lambda expression Func<> delegate etc).Then it doesn' t work with 2.0 version.

If you develop a project using linq on your local pc, simply make a standard deploy (e.g. copy dll, aspx etc) to server production and it will works. No special actions are required.

i hope i help you

stefano m
A: 

LINQ runs on .NET CLR 2.0 runtime, but to be able to compile and use your LINQ code you need .NET 3.5 (C# 3.0 compiler), since .NET 3.5 adds some LINQ-related assemblies to the framework.

liggett78
+3  A: 

I would encourage you to check out LinqPad as a learning tool. It's a standalone application that lets you play with Linq queries without worrying about getting it to run on a server.

Danimal
Yes, I really love LINQPad. It's one of the must-have tool to study linq, and now works perfectly with Entity Framework!
tanathos
+3  A: 

probably should read Scott Guthries series of articles on LINQ:

Here are links to the various 8 parts. you will need framework 3.5 if I am not mistaken to make this work.

The series with detailed step by step instructions starts here: Part 1

MikeJ
+2  A: 
tom.dietrich
A: 

LINQ requires .NET v3.5

An excellent tool for getting to know and practice LINQ is Joseph Albahari's LINQPad

AR
A: 

OK, first about the .NET 3.5 thing. The runtime(CLR) of 3.5 is still the same as in .NET 2.0. There are a bunch of new libraries plus (among other things) a new C#-Compiler.

So to run LINQ in theory you just need to have .NET 2.0 installed and throw a few additional assemblies into the GAC. If you want to know which ones, please add this to your question, I'm too lazy to look it up now.

If you can, just install the .NET 3.5 Framework on your server and yes, all .NET 2.0 programs will work there as before. Don't forget to scan the readme though :-)

I don't really understand your "What do I need to get up and running" question though. Do you want to to learn about LINQ? Try LinqPad. Do you want to develop solutions with LINQ? Then at a minimum I would recommend VS2008 Express.

To compile LINQ expressions you have to use the C# 3.0 compiler which isn't in the .NET 2.0 framework. As stated above the output of that compiler is compatible with .NET 2.0 though.

TToni
+7  A: 
Travis Johnson
A: 

ZAIN Naboulsi has some LINQ goodies. Check 'em out!

http://blogs.msdn.com/zainnab/archive/2008/03/29/collection-of-linq-resources.aspx

MarlonRibunal
A: 

Keep learning LINQ in simple by following Hooked on LINQ

+1  A: 

You have to at least have .Net 2.0 sp1 on your server, and you will have to copy locally handful of assemblies, like System.core, etc...

but without SP1 you will not be able to execute LINQ code because of issues in System.dll.

Collin Estes