开发者

Missing namespaces, LINQ works in web app but not website!

开发者 https://www.devze.com 2022-12-08 21:44 出处:网络
Okay guys, I have an asp.net website set up to target the 3.5 framework, using Linq to Sql.However, the site won\'t build, and i get missing namespace and assembly exception whenever i try to.

Okay guys, I have an asp.net website set up to target the 3.5 framework, using Linq to Sql. However, the site won't build, and i get missing namespace and assembly exception whenever i try to.

Here's the catch, I have installed 3.5 SP1, and I have added the System.Core, System.Data.Linq, System.Xml.Linq, and System.Data.DataSet开发者_StackOverflowExtensions assemblies to the project. What's more is, if I build the same project as a WEB APP (that compiles to a .dll), it compiles and runs just fine. What the heck is going on?


Alter the Web.config file and add the namespaces you want under the <pages> tag in <system.web>:

<pages>
        <namespaces>
                <add namespace="'System.Data.Linq"/>
                 // snip the rest
        </namespaces>
</pages>

Refer to this SO question.

0

精彩评论

暂无评论...
验证码 换一张
取 消