Reference problem using System.Linq [modified]
-
I have an asp.NET 3.5 web project in C# that includes references to
System.Core
System.Data.Linq
System.Xml.Linqand a page with the following test code ...
var a = (from b
in columns
where b.IndexOf("IDENTITY") == -1
select b).Single();The solution compiles, but when I run the application I get the following error ...
Compilation Error
Description: An error occurred during the compilation of a
resource required to service this request. Please review
the following specific error details and modify your
source code appropriately.Compiler Error Message: CS0234: The type or namespace name 'Linq'
does not exist in the namespace 'System' (are you missing an assembly reference?)Source Error:
Line 15: using System.Text;
Line 16:
Line 17: using System.Linq;Can anyone help? EDIT: I've just found this page http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3114187&SiteID=1[^] It looks like I need to add the correct version of the references and add some information to the web.config file. EDIT 2: I've checked all the references and they are fine, now I get a different error ... CS1026: ) expected yet this works fine in a console application with exactly the same references!?
Jim
modified on Thursday, May 8, 2008 5:23 PM
-
I have an asp.NET 3.5 web project in C# that includes references to
System.Core
System.Data.Linq
System.Xml.Linqand a page with the following test code ...
var a = (from b
in columns
where b.IndexOf("IDENTITY") == -1
select b).Single();The solution compiles, but when I run the application I get the following error ...
Compilation Error
Description: An error occurred during the compilation of a
resource required to service this request. Please review
the following specific error details and modify your
source code appropriately.Compiler Error Message: CS0234: The type or namespace name 'Linq'
does not exist in the namespace 'System' (are you missing an assembly reference?)Source Error:
Line 15: using System.Text;
Line 16:
Line 17: using System.Linq;Can anyone help? EDIT: I've just found this page http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3114187&SiteID=1[^] It looks like I need to add the correct version of the references and add some information to the web.config file. EDIT 2: I've checked all the references and they are fine, now I get a different error ... CS1026: ) expected yet this works fine in a console application with exactly the same references!?
Jim
modified on Thursday, May 8, 2008 5:23 PM
I used to get a lot of errors about LINQ earlier. You need to re-create the references again for LINQ from following path: C:\WINDOWS\Microsoft.NET\Framework\v3.5
Best Regards, Sam Xavier www.componentone.com