Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 30th, 2004, 10:54 PM
Authorized User
 
Join Date: Jul 2003
Location: Memphis, TN, USA.
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default Compilation Error: 'Global' is ambiguous??

Hi,
I have created an appl. using 'The Phile' as a template. I have the following
compilation error when I try to run my default (home) page--plz look down through
the error msg and then the global.asax.vb file I've included and see if you can
help with what needs fixing here:

<code>
Server Error in '/Vendorscape' Application.

--------------------------------------------------------------------------------

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: BC30560: 'Global' is ambiguous in the namespace 'FYRM.VendorScape.Web'.

Source Error:

Line 31: <System.Runtime.CompilerServices.CompilerGlobalSco peAttribute()> _
Line 32: Public Class Global_asax
Line 33: Inherits FYRM.VendorScape.Web.Global
Line 34:
Line 35: Private Shared __initialized As Boolean = false

Source File: C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempora ry ASP.NET Files\vendorscape\fd45cafa\afb208bb\pwt9ileb.0.vb Line: 33


Show Detailed Compiler Output:


C:\WINNT\System32> "c:\winnt\microsoft.net\framework\v1.1.4322\vbc.ex e" /t:library /utf8output /R:"c:\winnt\assembly\gac\system.data\1.0.5000.0__b 77a5c561934e089\system.data.dll" /R:"c:\winnt\assembly\gac\system\1.0.5000.0__b77a5c 561934e089\system.dll" /R:"c:\winnt\assembly\gac\system.web\1.0.5000.0__b0 3f5f7f11d50a3a\system.web.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temp orary asp.net files\vendorscape\fd45cafa\afb208bb\assembly\dl2\e 88ecea0\0026e557_7016c401\core.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temp orary asp.net files\vendorscape\fd45cafa\afb208bb\assembly\dl2\8 13e5b44\0080475a_7016c401\vendorscape.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temp orary asp.net files\vendorscape\fd45cafa\afb208bb\assembly\dl2\0 7a3a9f3\002d684a_4c13c401\fyrm.vendorscape.dll" /R:"c:\winnt\assembly\gac\system.enterpriseservices \1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseser vices.dll" /R:"c:\winnt\assembly\gac\system.web.services\1.0.5 000.0__b03f5f7f11d50a3a\system.web.services.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temp orary asp.net files\vendorscape\fd45cafa\afb208bb\assembly\dl2\e b774bc7\00531659_7016c401\accounts.business.dll" /R:"c:\winnt\assembly\gac\system.xml\1.0.5000.0__b7 7a5c561934e089\system.xml.dll" /R:"c:\winnt\assembly\gac\system.drawing\1.0.5000.0 __b03f5f7f11d50a3a\system.drawing.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temp orary asp.net files\vendorscape\fd45cafa\afb208bb\assembly\dl2\d 50a9269\0026e557_7016c401\accounts.data.dll" /R:"c:\winnt\assembly\gac\system.web.mobile\1.0.500 0.0__b03f5f7f11d50a3a\system.web.mobile.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temp orary asp.net files\vendorscape\fd45cafa\afb208bb\assembly\dl2\d 7c47a78\0026e557_7016c401\accounts.configuration.d ll" /out:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Te mporary ASP.NET Files\vendorscape\fd45cafa\afb208bb\pwt9ileb.dll" /D:DEBUG=1 /debug+ "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempor ary ASP.NET Files\vendorscape\fd45cafa\afb208bb\pwt9ileb.0.vb"


Microsoft (R) Visual Basic .NET Compiler version 7.10.3052.4

for Microsoft (R) .NET Framework version 1.1.4322.573

Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.


C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Tempora ry ASP.NET Files\vendorscape\fd45cafa\afb208bb\pwt9ileb.0.vb( 33) : error BC30560: 'Global' is ambiguous in the namespace 'FYRM.VendorScape.Web'.


        Inherits FYRM.VendorScape.Web.Global
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~


Show Complete Compilation Source:

Line 1: '-----------------------------------------------------------------------------
Line 2: ' <autogenerated>
Line 3: ' This code was generated by a tool.
Line 4: ' Runtime Version: 1.1.4322.573
Line 5: '
Line 6: ' Changes to this file may cause incorrect behavior and will be lost if
Line 7: ' the code is regenerated.
Line 8: ' </autogenerated>
Line 9: '-----------------------------------------------------------------------------
Line 10:
Line 11: Option Strict Off
Line 12: Option Explicit On
Line 13:
Line 14: Imports Microsoft.VisualBasic
Line 15: Imports System
Line 16: Imports System.Collections
Line 17: Imports System.Collections.Specialized
Line 18: Imports System.Configuration
Line 19: Imports System.Text
Line 20: Imports System.Text.RegularExpressions
Line 21: Imports System.Web
Line 22: Imports System.Web.Caching
Line 23: Imports System.Web.Security
Line 24: Imports System.Web.SessionState
Line 25: Imports System.Web.UI
Line 26: Imports System.Web.UI.HtmlControls
Line 27: Imports System.Web.UI.WebControls
Line 28:
Line 29: Namespace ASP
Line 30:
Line 31: <System.Runtime.CompilerServices.CompilerGlobalSco peAttribute()> _
Line 32: Public Class Global_asax
Line 33: Inherits FYRM.VendorScape.Web.Global
Line 34:
Line 35: Private Shared __initialized As Boolean = false
Line 36:
Line 37: Public Sub New()
Line 38: MyBase.New
Line 39: If (ASP.Global_asax.__initialized = false) Then
Line 40: ASP.Global_asax.__initialized = true
Line 41: End If
Line 42: End Sub
Line 43: End Class
Line 44: End Namespace
Line 45:

--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
</code>

This is auto-generated code in the WINNT directory that holds temp files for running
ASP.Net applications...that's as far as I understand about this. Here's my
global.asax.vb file in the application...

<code>
Imports System.Web
Imports System.Web.SessionState
Imports System.Diagnostics
Imports System.Collections
Imports System.ComponentModel

Namespace VendorScape.Web

    Public Class Global

        Inherits System.Web.HttpApplication

#Region " Component Designer Generated Code "

        Public Sub New()

            MyBase.New()

            'This call is required by the Component Designer.
            InitializeComponent()
            'Add any initialization after the InitializeComponent() call
        End Sub

        'Required by the Component Designer
        Private components As System.ComponentModel.IContainer

        'NOTE: The following procedure is required by the Component Designer
        'It can be modified using the Component Designer.
        'Do not modify it using the code editor.
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
            components = New System.ComponentModel.Container
        End Sub

#End Region


        ' Fires when the application is started
        ' ---
        Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
        End Sub

        ' Fires when the session is started
        ' ---
        Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
        End Sub

        ' Fires at the beginning of each request
        ' ---
        Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
        End Sub

        ' Fires upon attempting to authenticate the use
        ' ---
        Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs)
        End Sub

        ' Fires when an error occurs
        ' ---
        Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)

            Dim currentError As Exception = Server.GetLastError()

            ' Write error to log file
            FYRM.WebModules.AppException.LogError(currentError .Message.ToString)

            ' Write error to screen
            FYRM.VendorScape.Web.VendorScapePage.ShowError(cur rentError)
            ' Clear error so that it does not bubble up
            Server.ClearError()

        End Sub

        ' Fires when the session ends
        ' ---
        Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
        End Sub

        ' Fires when the application ends
        ' ---
        Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
        End Sub

    End Class

End Namespace
</code>


...again, if you're familiar with 'ThePhile' you'll see that I have
used it pretty much verbatim.
TFTH (Thanks for the help!)


R Corcoran, Jr.
__________________
Reid C.
  #2 (permalink)  
Old March 31st, 2004, 04:05 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Did you recently change the name of your assembly?

I have seen this error a few times when I renamed my assembly. I left the old one in the Bin folder as well, and thus ended up with two assemblies with the same Global classed defined in the same namespace.

Clear your Bin folder, recompile and the error should go away.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #3 (permalink)  
Old March 31st, 2004, 12:08 PM
Authorized User
 
Join Date: Jul 2003
Location: Memphis, TN, USA.
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks much, Imar!!!
I hope, with a bit more experience (or a lot more, more likely)
that I can return the favor!!!

R Corcoran, Jr.
  #4 (permalink)  
Old November 11th, 2004, 04:46 AM
Registered User
 
Join Date: Nov 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks it worked perfectly...
you are the man....


  #5 (permalink)  
Old August 26th, 2006, 03:38 AM
Registered User
 
Join Date: Aug 2006
Location: Stoke on Trent, Staffordshire, United Kingdom.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Excellent advice!
I had recompiled and left the old .dll in the Bin folder. Once I cleared the folder and recompiled everything worked.
I should of checked the forum two hours ago.

Paul D Simcock
  #6 (permalink)  
Old January 15th, 2008, 06:24 PM
Registered User
 
Join Date: Jan 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

When I build my webapplication there are no errors, I then place the deployed application (aspnet_compiler -p "C:\MyApp" -v / C:\MyApp\deploy) on my hosting provider's server.
I then get the following error: asp.net 'global_asax' is ambiguous in the namespace 'ASP'

You say clear the bin folder, but I have the following files there:
AdamTibi.Web.UI.Validators.dll
AdamTibi.Web.UI.Validators.dll.refresh
AjaxControlToolkit.dll
AjaxControlToolkit.dll.refresh
AjaxControlToolkit.pdb
AJAXExtensionsToolbox.dll
HandlersAndModules.dll
HotGridView.dll
Intelligencia.UrlRewriter.dll
RssToolkit.dll
RssToolkit.dll.refresh
skmValidators.dll
skmValidators.dll.refresh
strings.dll
strings.resources
strings.txt
System.Web.Extensions.Design.dll
System.Web.Extensions.dll
Validators.dll
WebControlCaptcha.dll.refresh

I dont understand that if I delete those files how they would end up back in my bin folder again...because some of these dll's I downloaded from third parties.
Please help!

Thanks!

Peter

Quote:
quote:Originally posted by Imar
 Did you recently change the name of your assembly?

I have seen this error a few times when I renamed my assembly. I left the old one in the Bin folder as well, and thus ended up with two assemblies with the same Global classed defined in the same namespace.

Clear your Bin folder, recompile and the error should go away.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #7 (permalink)  
Old January 15th, 2008, 07:38 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Peter,

Difficult to say; I would clear the Bin folder and then add them one by one again and see where it breaks. You don't need to refresh files at all on your production server...

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
  #8 (permalink)  
Old January 16th, 2008, 04:02 AM
Registered User
 
Join Date: Jan 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

thanks for your reply.
Where should I clear the bin folder?

since I use 'deploy' all my files are placed compiled in the bin folder.
Locally I dont have this problem at all.
So are you saying I should delete all files on the production server and add them one by one again?

OR

Should I clear my local bin folder and place the files one by one back and with each new added file test if the deploy works correct?

If I observe my files in the bin folder, I really dont see any dll that could cause the error I now receive...do you?

Thanks!
  #9 (permalink)  
Old January 28th, 2008, 03:11 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

 Hi Peter,

I completely overlooked this post as I wasn't subscribed to it somehow. Were you able to resolve the problem after all?

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
  #10 (permalink)  
Old November 25th, 2008, 04:03 PM
Registered User
 
Join Date: Nov 2008
Location: Charlotte, NC, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm also dealing with ambiguous global. I have recently upgraded a ASPX website from 1.1 to 2.0, and used a language converter to change from VB to CS. The solution file has been renamed, but all projects and their produced DLLs retain their original name. I also used VS 2008 to "convert to web project", so I've got all those fancy resx and designer files.

I have tried deleting both the bin folder as well as all .NET temporary folders, and also did a file search to ensure only one global.aspx and global.aspx.cs.

I'm no mastermind on the innerworkings of a web project. I keep seeing the above advice on any other forums I've looked at, so I'm all ears for new ideas.

TIA,
Mark

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ Compilation error indupriyav C++ Programming 0 February 5th, 2007 08:37 AM
Error: "Ambiguous match found" Ser_Supremo C# 3 November 7th, 2006 06:58 AM
Compilation Error don baroo ASP.NET 1.0 and 1.1 Basics 2 August 26th, 2005 08:05 PM
Compilation error Giri ASP.NET 1.0 and 1.1 Basics 3 August 3rd, 2005 04:14 PM
compilation error saint Classic ASP Databases 2 June 23rd, 2003 04:08 AM



All times are GMT -4. The time now is 10:29 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.