[除错]ASP.NET: Compilation Error , defined in multiple places

作者: John Lau

http://sapces.msn.com/members/yollelaw

今天调试时又发现了一个BUG, 错误提示如下:

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1595: 'ASP.FOLDER_Display_Pendding_ascx' is defined in multiple places; using definition from 'd:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\storm\df9780a4\135f598d\mqa0kutp.0.cs'

Source Error:

|

`

Line 32:         
Line 33:         public FOLDER_Display_Pendding_ascx() {
Line 34:             if ((ASP.FOLDER_Display_Pendding_ascx.__initialized == false)) {
Line 35:                 ASP.FOLDER_Display_Pendding_ascx.__initialized = true;
Line 36:             }

`

** Source File: ** d:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\storm\df9780a4\135f598d\mqa0kutp.0.cs ** Line: ** 34

产生错误的原因是: 我定义了两个叫做FOLDER_Display_Pendding.ascx的用户控件, 因为在不同目录下,所以这并不会有什么问题; 但是我在其中的一个FOLDER_Display_Pendding.ascx控件中用到了另外一个同名的控件做为它的子控件, 结果这个控件就搞不懂引用的那个子控件是指向自已的还是指向另一个目录的.
解决办法: 改变其中一个控件的名字重新编译便可

我觉得这个问题的主要责任应由Microsoft承担,因为控件使用是已经注册, 而且还有指定的前缀, 完全可以和<%@ Page中的定义区别开来, 为什么不能同使用呢?


`

Line 32:         
Line 33:         public FOLDER_Display_Pendding_ascx() {
Line 34:             if ((ASP.FOLDER_Display_Pendding_ascx.__initialized == false)) {
Line 35:                 ASP.FOLDER_Display_Pendding_ascx.__initialized = true;
Line 36:             }

`

** Source File: ** d:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\storm\df9780a4\135f598d\mqa0kutp.0.cs ** Line: ** 34

产生错误的原因是: 我定义了两个叫做FOLDER_Display_Pendding.ascx的用户控件, 因为在不同目录下,所以这并不会有什么问题; 但是我在其中的一个FOLDER_Display_Pendding.ascx控件中用到了另外一个同名的控件做为它的子控件, 结果这个控件就搞不懂引用的那个子控件是指向自已的还是指向另一个目录的.
解决办法: 改变其中一个控件的名字重新编译便可

我觉得这个问题的主要责任应由Microsoft承担,因为控件使用是已经注册, 而且还有指定的前缀, 完全可以和<%@ Page中的定义区别开来, 为什么不能同使用呢?


Published At
Categories with Web编程
Tagged with
comments powered by Disqus