I just made a Linq-to-SQL .dbml file in Visual Studio 2010.
I'm getting the following 2 errors, a total of 60 times in total, mostly the first.
I've found various similar questions here and on other sites, all of which seem to say that some extra assembly needs to be added.
I've added every one suggested, the problem persists. Another odd thing is that VS2010 itself doesn't underline the errors in the editor screen, but it does show them in the error log.
Anyways, I've seen all the existing topics and applied their solutions, the problem persists.
Some technical details:
And here's the assemblies listed in my web.config file:
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Services.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Services.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.SqlXml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
I found this link which solved it for me. The net is that the following must be added to web.config:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
</assemblies>
</compilation>
</system.web>
</configuration>
Note that the configuration/system.web/compilation tags are already there, and the assemblies/add assembly tags need to be added. This even though System.Data.Linq is readily found by VS when building.
The failure was in App_Code.LinqToObservations.designer.cs, code that's generated by Linq from my LinqToObservations.dbml file.
(Additional background: I likely got into this situation because I enabled Linq after the fact using the procedure found here.)
I've been having the same problem on exactly the same config except for my Windows 7 is 64-bit. Got it solved by doing [project name] -> References -> Add reference -> System.Data.Linq
Why do you add references by hand?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With