Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
<?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
Posted
Comments
JoCodes 11-Nov-13 4:57am    
Have you checked your targetframework is set to 3.5 framework/?
Parmendra choudhary 11-Nov-13 6:58am    
thanks u sir.............
JoCodes 11-Nov-13 13:20pm    
Welcome ...:)

Right click on the project, select add reference and choose these two dlls from the appropriate location.
 
Share this answer
 
Comments
Parmendra choudhary 11-Nov-13 4:11am    
same problem
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...
 
Share this answer
 
Its a version Error. my code is in 4.0 and server set 2.0
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900