.netvisual-studiolinq-to-sql

Is it true that I can still use Linq to SQL in design time even if you are targeting .net 2 in your application?


Someone recently said that I can use Linq to SQL in my application even if I am targeting the .net 2 framework. Is that true?

How does that work? How do you setup your references? Any gotchas I need to be concerned about? Is there some special way to set that up?


Solution

  • You can, but you need to set System.Core to be a local copy version in your application because it doesn't exist in .NET 2 and it's needed for Linq. You need a minimum of .NET 2, SP1 to do this trick though because there's an update in System.dll that is needed.

    It's worth noting that you have to develop on a system with .NET 3 on to do this. The deployed code will still work on .NET2 as long as you follow the steps I outlined above.