Wednesday, April 28, 2010

Error: "The type or namespace name 'Linq' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)"

I got this error when I uploaded to the web server a new version of my site using LINQ. Everything worked on my local machine and on a local web server so I knew my code was right.
At first I thought the web server does not support LINQ and I asked the support group of the web server to enable LINQ for my site, buy they insisted that ASP.NET 3.5 that support LINQ is already installed and insisted that the problem is in my code.
Eventually I remembered that I didn't update the web.config file, since it is different for my local machine and for the web server, and I didn't want to overwrite the changes. When comparing the two files, I found out that this line is missing on the web.config file on the web server:
<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=..."/>
After adding this line, I didn't see this message on the web server any more.

No comments:

Post a Comment