Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.8k views
in Technique[技术] by (71.8m points)

asp.net - BC30560: 'default_aspx' is ambiguous in the namespace 'ASP'

When I compiled my latest asp.net program and trying to run on the test server, I am getting this error

Line 46:             Dim dependencies() As String
Line 47:             CType(Me,Global.System.Web.UI.Page).AppRelativeVirtualPath = "~/default.aspx"
Line 48:             If (Global.ASP.default_aspx.__initialized = false) Then
Line 49:                 dependencies = New String(0) {}
Line 50:                 dependencies(0) = "~/default.aspx"


Source File: C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesocbuildc0c442fff0292c99App_Web_default.aspx.cdcab7d2.4ubu1wgu.0.vb    Line: 48 

Detailed errors when I expand the compiler output...

Microsoft (R) Visual Basic Compiler version 8.0.50727.3053
for Microsoft (R) .NET Framework version 2.0.50727.3053
Copyright (c) Microsoft Corporation.  All rights reserved.

C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesocbuildc0c442fff0292c99App_Web_default.aspx.cdcab7d2.4ubu1wgu.0.vb(48) : error BC30560: 'default_aspx' is ambiguous in the namespace 'ASP'.

            If (Global.ASP.default_aspx.__initialized = false) Then
                ~~~~~~~~~~~~~~~~~~~~~~~                            
C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesocbuildc0c442fff0292c99App_Web_default.aspx.cdcab7d2.4ubu1wgu.0.vb(51) : error BC30560: 'default_aspx' is ambiguous in the namespace 'ASP'.

                Global.ASP.default_aspx.__fileDependencies = Me.GetWrappedFileDependencies(dependencies)
                ~~~~~~~~~~~~~~~~~~~~~~~                                                                 
C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesocbuildc0c442fff0292c99App_Web_default.aspx.cdcab7d2.4ubu1wgu.0.vb(52) : error BC30560: 'default_aspx' is ambiguous in the namespace 'ASP'.

                Global.ASP.default_aspx.__initialized = true
                ~~~~~~~~~~~~~~~~~~~~~~~                     
C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesocbuildc0c442fff0292c99App_Web_default.aspx.cdcab7d2.4ubu1wgu.0.vb(76) : error BC30560: 'default_aspx' is ambiguous in the namespace 'ASP'.

        Private Sub __BuildControlTree(ByVal __ctrl As default_aspx)
                                                       ~~~~~~~~~~~~ 
C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesocbuildc0c442fff0292c99App_Web_default.aspx.cdcab7d2.4ubu1wgu.0.vb(100) : error BC30560: 'default_aspx' is ambiguous in the namespace 'ASP'.

            Me.AddWrappedFileDependencies(Global.ASP.default_aspx.__fileDependencies)
                                          ~~~~~~~~~~~~~~~~~~~~~~~                    
C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Filesocbuildc0c442fff0292c99App_Web_default.aspx.cdcab7d2.4ubu1wgu.1.vb(31) : error BC30560: 'default_aspx' is ambiguous in the namespace 'ASP'.

            Return New ASP.default_aspx
                       ~~~~~~~~~~~~~~~~

I checked a few things and all of them turned out to be okay:

[*] Default is not defined twice anywhere

[*] Everything was working on the last release 1 week back

[*] There are no old files that are still staying with the compiled files. Also I cleared the temporary files many times.

[*] I have tried with other aspx files and all of them is giving ambiguous error (error in different source files...)

[*] The original source works just fine! only the error shows up on the compiled code.

Any ideas or any clues on how to resolve this ambiguity.

Thanks SK

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I just solved this problem with the assistance following link: http://www.netomatix.com/development/usercontrols2.aspx

Add this on aspx or ascx page ClassName="MyModule"

   <%@ Control Language="vb" AutoEventWireup="false" CodeBehind="MyModule.ascx.vb" ClassName="MyModule" %>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...