BC30560:“default_aspx” 在命名空间“ASP”中不明确;
当我编译最新的 asp.net 程序并尝试在测试服务器上运行时,我收到此错误
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:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_Web_default.aspx.cdcab7d2.4ubu1wgu.0.vb Line: 48
展开编译器输出时出现详细错误...
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:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_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:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_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:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_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:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_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:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_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:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_Web_default.aspx.cdcab7d2.4ubu1wgu.1.vb(31) : error BC30560: 'default_aspx' is ambiguous in the namespace 'ASP'.
Return New ASP.default_aspx
~~~~~~~~~~~~~~~~
我检查了一些内容,结果发现一切都正常:
[ *] 默认值未定义两次 任何地方
[*] 一切正常 在 1 周前的最后一个版本中
[*] 没有旧文件 仍然保留编译的 文件。 我还清除了临时 文件多次。
[*] 我努力了 与其他 aspx 文件和所有 他们给出了模棱两可的错误 (不同源文件中的错误...)
[*] 原始源仅适用 美好的! 仅错误显示在 编译的代码。
关于如何解决这种歧义的任何想法或任何线索。
谢谢 SK
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:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_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:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_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:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_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:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_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:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_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:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_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:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ocbuild\c0c442ff\f0292c99\App_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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
当更改消费项目引用的库的名称/命名空间时,我在消费项目中遇到了这个问题。
问题是使用项目 Bin 文件夹具有每个名称/命名空间名称的 DLL 副本。
删除使用项目 Bin 文件夹并重建即可解决。
I ran into this issue in consuming project when changing name/namespace of a library that consuming project referenced.
Issue is consuming project Bin folder has copy of DLL with each name/namespace name.
Deleting the consuming project Bin folder and rebuilding solved.
好吧,这是我花了三天时间解决这个问题后发现的。
最后我想,如果我从解决方案中删除除一个项目(导致问题)之外的所有项目,我可以将其隔离到default.skin。 这个问题似乎非常不稳定,因为如果我从此文件中删除某些行,它就会消失。 然而,这并不一致,问题随机出现。
因此,在失去了在代码中修复它的所有希望之后,我决定尝试另一种方式。 我将 aspnet_compiler 命令的选项从 -prefix 开关(为每个文件夹创建一个 dll)更改为 -o (所有编译的 ui 都放在一个 dll 中),问题就消失了!
看来这个问题是由于 aspnet_compiler 中的一些错误造成的。 它在这个版本中以某种方式被触发,我无法弄清楚。
我正在考虑转向更稳定的asp.net 3.5SP1(或者也许等待asp.net 4.0)有什么建议吗?
Okay here is what I found after spending three days on this problem.
Finally I figured that if I removed all the projects from the solution except one (that was causing problem) I could isolated it to default.skin. The problem seemed to be very erratic because it started going away if I deleted certain lines from this file. However, this was not consistent and the problem came and went at random.
So after losing all hopes of fixing it in the code, I decided to try it another way. I changed the option of aspnet_compiler command from -prefix switch (a dll is created for each folder) to -o (all compiled ui is put in one dll), the problem went away!!!
It seems that the problem is due to some bug in the aspnet_compiler. It got triggered in this version somehow that I could not figure out.
I am thinking of moving to more stable asp.net 3.5SP1 (or maybe wait for asp.net 4.0) any suggestions?
我刚刚通过以下链接的帮助解决了这个问题: http://www.netomatix.com/development/ usercontrols2.aspx
将其添加到 aspx 或 ascx 页面 ClassName="MyModule"
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"
我发现混合命名空间确实会让事情变得混乱。
清理它的最佳方法是删除 Web 项目中的所有命名空间声明,并确保它们在依赖项目中保持一致。 不要忘记检查项目属性和生成的 .designer.vb 文件。
另外,听起来您有一个名为 ASP 的顶级目录 - 这可能也没有帮助。 我会完全删除该目录,看看这是否有助于解决问题。 不久前,我确实向 MS 报告了这个错误,甚至向他们提供了一个可重现的示例,但从未收到他们的任何回复。
I've found that mixing Namespaces can really confuse things.
The best way to clean it up is to remove all the namespace declarations in your web project, and make sure that they're consistent in dependent projects. Don't forget to check the project properties, and the generated .designer.vb files.
Also, it sounds like you have a top-level directory named ASP - that's probably not helping things either. I'd get rid of that directory entirely, and see if that helps the problem. I did report this as a bug to MS a while back, and even provided them with a reproducible example, but never heard anything back from them.
我通过将命名空间放在类之上解决了这个问题
I solved this problem by putting the namespace above the class
我们在测试服务器上也遇到了同样的问题。 我们在 bin 文件中发现了应用程序 dll 的副本。 它的名称与原始 dll 略有不同(其中缺少一个“.”),但包含相同的类型。 我们把它删除了,一切又开始工作了。
We had the same problem on out test servers. We found a duplicate of our application dll in the bin file. It's name was slightly different (missing a single "." in it) than the original dll but it contained the same types. We removed it and everything started working again.
您需要确保用户控件也随页面复制到测试服务器。
You need to make sure that the user control is also copied across with the page to your test server.
在我检查了与塞缪尔相同的项目后:
[*]默认值在任何地方都没有定义两次
[*] 1 周前在其他计算机上一切正常
[*] 编译后的文件中不存在任何旧文件。 我也多次清除临时文件。
[*] 我尝试过其他 aspx 文件,所有这些文件都给出了不明确的错误(不同源文件中的错误...)
[*] 原始来源工作得很好! 仅错误显示在编译的代码上。
(...)
我只是让我的代码在 VS-2015 中保持原始状态,并在 CMD 窗口中执行:
并且一切都运行正常,没有任何错误。
后续在VS-2015环境下编译也OK。
After I checked the same items as Samuel:
[*] Default is not defined twice anywhere
[*] Everything was working on other computer 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.
(...)
I just let my code as originaly in VS-2015 and in CMD window I executed:
And every thing was running Ok without any error.
Subsequents compilations in VS-2015 environment were also Ok.
我正面临这个错误。
我解决的是这样的:
当创建“publish”文件夹以将项目部署到生产环境时,Visual Studio编译器在“bin”文件夹中添加这2个文件:
我刚刚删除,我的页面再次正常工作。
希望这也能帮助别人。
I was facing this error.
I solved is this way:
When create the "publish" folder to deploy the project to production environment, the visual studio compiler add this 2 files in "bin" folder:
I just deleted, I my page works fine again.
Hope this help someone too.