Tuesday, March 8, 2011

LINQ in upgraded VB.NET project

If you want to use LINQ in VB.NET and if the project was upgraded from .NET 2.0 to a newer version please make sure to set "Option infer" on under compile options. Otherwise you might no be able to use the methods of System.Linq.Enumerable methods like count, average etc.

You might also need the following namespaces depending on your current task:

Imports System.Linq
Imports System.Data.Linq
Imports System.Xml.Linq

The rest of the configuration tasks can be found here: http://msdn.microsoft.com/de-de/library/bb546156.aspx

No comments: