Reputation: 10153
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?
Upvotes: 10
Views: 2422
Reputation: 811
To get up and running, I would definitely recommend checking out LINQ in Action.
Your compiler needs to be .NET 3.5 framework. If you are copying over only compiled code, then you will not need 3.5 on your server, you only need it on your development machine. This can help if your server admin is unwilling to install the 3.5 framework on your server. However, if you are publishing source code, say to a development server to compile, then yes that server will need 3.5.
Once you have the 3.5 framework installed, you can run web apps either as 2.0 or 3.5. All you have to do is specify it in your Web.Config file.
If you are interested in working with LINQ to SQL and managing dbml files, you will need Visual Studio 2008. However, Visual Studio 2005 will still compile dbml files properly, given that you have the 3.5 framework installed.
Upvotes: 8
Reputation: 5789
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.
Upvotes: 2
Reputation: 4097
ZAIN Naboulsi has some LINQ goodies. Check 'em out!
http://blogs.msdn.com/zainnab/archive/2008/03/29/collection-of-linq-resources.aspx
Upvotes: 0
Reputation: 9391
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.
Upvotes: 0
Reputation: 40535
LINQ requires .NET v3.5
An excellent tool for getting to know and practice LINQ is Joseph Albahari's LINQPad
Upvotes: 0
Reputation: 8347
You actually only need .net 3.5 on the development machine. If you have 2.0 SP1 on the server, and you set all the .net references in your project of version 3.5.0.0 to "copy local", you can run a 3.5 executable on a 2.0 machine.
makeitlooklikethis http://img90.imageshack.us/img90/4217/35haxxx2.png
As a side note, you may have to delete the yourexecutable.exe.config in order for it to run. For some reason 2.0 sp1 has issues with .configs created by 3.5
I have two live apps running with this setup currently, it works very well.
Upvotes: 3
Reputation: 14565
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
Upvotes: 3
Reputation: 7710
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.
Upvotes: 4
Reputation: 11358
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.
Upvotes: 0
Reputation: 4224
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
Upvotes: 0
Reputation: 11782
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.
Upvotes: 2