CS0234: The type or namespace name 'Linq' does not exist in the namespace 'System.Data'
2017-10-02 16:31
921 查看
转载 Posted on October 26, 2010 by
Jed
If you receive an error in your .aspx page that looks somethinglike:
Compilation Error
Description: An error occurred during the compilation of aresource required to service this request. Please review thefollowing specific error details and modify your source codeappropriately.
Compiler Error Message: CS0234: The type or namespace name‘Linq’ does not exist in the namespace ‘System.Data’ (are youmissing an assembly reference?)
You may be able to resolve the error simply by adding anassembly reference to your Web.config file.
In our example error you will notice that the compiler is havingproblems finding the “Linq” namespace within the “System.Data”namespace. It is strange to me that the Linq namespace cannot befound since the reference has been added to the web applications“References”.
Regardless, to explicitly tell the compiler toinclude the Linq namespace add the following attribute to theWeb.config file.
By adding the Linq assembly to the system.web configuration’sassemblies, the error noted at the top of this post wasresolved.
Jed
If you receive an error in your .aspx page that looks somethinglike:
Compilation Error
Description: An error occurred during the compilation of aresource required to service this request. Please review thefollowing specific error details and modify your source codeappropriately.
Compiler Error Message: CS0234: The type or namespace name‘Linq’ does not exist in the namespace ‘System.Data’ (are youmissing an assembly reference?)
You may be able to resolve the error simply by adding anassembly reference to your Web.config file.
In our example error you will notice that the compiler is havingproblems finding the “Linq” namespace within the “System.Data”namespace. It is strange to me that the Linq namespace cannot befound since the reference has been added to the web applications“References”.
Regardless, to explicitly tell the compiler toinclude the Linq namespace add the following attribute to theWeb.config file.
<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>
By adding the Linq assembly to the system.web configuration’sassemblies, the error noted at the top of this post wasresolved.
相关文章推荐
- [EntLib]解决The type or namespace name 'Data' does not exist in the namespace 'Microsoft.Practices.EnterpriseLibrary' 的错误
- Unity3d——报错 The type or namespace name `Ports' does not exist in the namespace `System.IO'
- The type or namespace name 'Windows' does not exist in the class or namespace 'System'
- CS0234 The type or namespace name 'Mvc' does not exist in the namespace 'Microsoft.AspNet' (are you
- Compiler Error Message: CS0234: The type or namespace name 'BorderDetails' does not exist in the class or namespace 'Infragistics.WebUI.Shared' (are you missing an assembly reference?)
- The type or namespace name 'Zhaopin' does not exist in the namespace 'LMSoft' 问题的解决
- Error:The type or namespace name 'Office' does not exist in the namespace 'Microsoft' 解决方法
- 解决The type or namespace name \'XXXX\' does not exist in the namespace \'XXXXXXXXX\' 的错误
- The type or namespace name 'Windows' does not exist in the namespace....
- The type or namespace name 'Service' does not exist 异常处理
- The type or namespace name 'AjaxControlToolkit' could not be found in the global namespace
- The type or namespace name 'AjaxControlToolkit' could not be found in the global namespace
- WCF分布式开发常见错误(4):The type or namespace name 'DataContract' could not be found DataContract找不到
- java.lang.UnsatisfiedLinkError,(A file or directory in the path name does not exist.
- The name does not exist in the namespace error in XAML
- 错误码: 1630 FUNCTION count does not exist. Check the 'Function Name Parsing and Resolution' section in
- RPC Fault faultString="[MessagingError message='Destination 'data-push' either does not exist or the destination has no channels
- The name 'AccordionLayout1' does not exist in the current
- Error:The name 'Encoding' does not exist in the current context 解决方法
- ADO.NET Entity Framework: The version of SQL Server in use does not support datatype 'datetime2'