如何设置webconfig以进行程序集引用 [英] How to set webconfig for assembly reference

查看:90
本文介绍了如何设置webconfig以进行程序集引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的webconfig文件.....

发送错误的两个命名空间...(错误2命名空间'系统中不存在类型或命名空间名称'Linq'。 Xml'(你错过了一个程序集引用吗?)D:\ Hospital \ Thhree Layer Application - Entities\Web\Billing\OutPatientBill.aspx.cs



使用System.Linq;

使用System.Xml.Linq;

如何添加程序集引用



MY webconfig File.....
And the the two namespace who send error...(Error 2 The type or namespace name 'Linq' does not exist in the namespace 'System.Xml' (are you missing an assembly reference?) D:\Hospital\Three Layer Application - Entities\Web\Billing\OutPatientBill.aspx.cs
)
using System.Linq;
using System.Xml.Linq;
how to add assembly reference

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>

  <connectionStrings>
    <add name="conn" connectionString="Data Source=ABCD;Initial Catalog=briefsof_medical;User ID=medical_01;Password=medical@123;" />
  </connectionStrings>
  <system.web>
    <compilation debug="true">
      <assemblies>
        <add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <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.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

      </assemblies>
    </compilation>
    <!--<customErrors mode="RemoteOnly" defaultRedirect="~/Default.aspx"/>-->
    <authentication mode="Windows"/>

    <pages controlRenderingCompatibilityVersion="3.5"/>

    <customErrors mode="Off"/>
  </system.web>
</configuration

推荐答案

右键单击项目,选择添加引用,然后从适当的位置选择这两个dll。
Right click on the project, select add reference and choose these two dlls from the appropriate location.


web.config 文件写的所有内容都是运行时的。 IIS和您的Web应用程序使用的含义。 Visual Studio及其编译器不使用它们(intellisense除外)。对于使用任何程序集的编译时,必须使用IDE添加对它的引用(项目 - >右键单击 - >添加引用)。



请参见此处 http://msdn.microsoft.com/en-us/library/s10awwz0(ⅴ = vs.85).aspx [ ^ ]



本文说明在编译 ASP.NET 期间使用汇编元素在作为响应提供页面之前在IIS中完成的那个阶段......
All thing written in web.config file are for run time. Meaning used by IIS and your web application. Visual Studio and it's compiler don't used them (except for intellisense). For compile time using of any assembly you must add reference to it using the IDE (Project->Right Click->Add Reference).

See here http://msdn.microsoft.com/en-us/library/s10awwz0(v=vs.85).aspx[^]

This article states that the assembly elements are used during compilation of ASP.NET that phase done in the IIS just before serving your page as a response...


它的版本错误。我的代码在4.0和服务器集2.0
Its a version Error. my code is in 4.0 and server set 2.0


这篇关于如何设置webconfig以进行程序集引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆