Getting started using Linq, what do I need?

后端 未结 12 1708
清酒与你
清酒与你 2021-02-14 07:59

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 be

相关标签:
12条回答
  • 2021-02-14 08:00

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

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

    0 讨论(0)
  • 2021-02-14 08:00

    To get up and running, I would definitely recommend checking out LINQ in Action.

    alt text

    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.

    0 讨论(0)
  • 2021-02-14 08:01

    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.

    0 讨论(0)
  • 2021-02-14 08:03

    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.

    0 讨论(0)
  • 2021-02-14 08:04

    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

    0 讨论(0)
  • 2021-02-14 08:07

    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.

    0 讨论(0)
提交回复
热议问题