Go Back   DeveloperBarn Forums > Programming & Scripting > .Net Development

Sponsored Links

Discuss "ambiguous in the namespace 'ASP'" in the .Net Development forum.

.Net Development - Learn about the Microsoft.Net framework and how to create powerful web-based (ASP.net) and client-based (Windows Forms) applications utilizing various languages such as C#, VB.Net, J# and others.


Reply « Previous Thread | Next Thread »
 
LinkBack Thread Tools Display Modes
  #1  
Old May 30th, 2008, 07:48 AM
richyrich's Avatar
Moderator


 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 395
Thanks: 26
Thanked 32 Times in 32 Posts
Blog Entries: 1
Rep Power: 1
richyrich will become famous soon enough

Awards Showcase
Classic ASP JavaScript 
Total Awards: 2

Default ambiguous in the namespace 'ASP'

I created a thread about this issue before but it's re-appeared and was wondering if anyone had any ideas how to fix it permanently. I thought I'd start a new thread as I've narrowed down the problem to a small area.

I have a few custom controls in my pages and every so often, normally after uploading a change to a BOL, DAL or BLL file the site will throw an exception saying so and so name is ambiguous in the namespace 'ASP'.

It always relates to either these custom controls or my master page.

The only way I've found to solve this issue is to include a ClassName in the Control declaration and call it some random name:
Code:
<@ Control Language="VB" ClassName="nvconcvr" codefile="client_tabs.ascx" inherits="client_tabs" %>
So, if I upload a changed file, I'd get an error saying nvconcvr is ambiguous in the namespace 'ASP'. It doesn't happen everytime a changed file is uploaded, just sometimes.

When it happens I have to change the random class name in my custom controls and master page to something else. I've also tried it without classnames, but then it just throws an exception on the .NET generated names.

I know it has something to do with the re-compiling when an App_Code file is uploaded, but wondered if there's anything I can do to resolve this permanently?

I've googled loads about it, but no-one seems to have a solution, other than changing the names, which becomes a bit tedious when you're making changes, re-uploading, testing and then get this exception, so you have to change 3 files and re-upload those.

Any ideas?
Reply With Quote
Sponsored Links
  #2  
Old May 30th, 2008, 09:22 AM
jmurrayhead's Avatar
The Barnfather

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 806
Thanks: 19
Thanked 74 Times in 71 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura about

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

Default

You say you're changing the class name in the directive...what about the codebehind files?

I also see this: codefile="client_tabs.ascx"

Is that the name of your codebehind file AND your page? Typically, with codebehinds, I use an extension of .ascx.vb or .aspx.vb and for C#, .ascx.cs or aspx.cs.
__________________
jmurrayhead
If you agree with me... click the icon!
If my post solved your problem, click the button in the lower right-hand corner of the post.

Join our Folding team: DeveloperBarn Folding
Reply With Quote
  #3  
Old May 30th, 2008, 09:40 AM
richyrich's Avatar
Moderator


 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 395
Thanks: 26
Thanked 32 Times in 32 Posts
Blog Entries: 1
Rep Power: 1
richyrich will become famous soon enough

Awards Showcase
Classic ASP JavaScript 
Total Awards: 2

Default

My bad...I mis-typed the codefile name
Code:
<%@ Control Language="VB" ClassName="vdsfvdf" CodeFile="client_tabs.ascx.vb" Inherits="client_tabs" %>
If I change the value in red, the ambiguous error stops until I change one of the DAL, BLL or BOL files. If I remove it, the same thing happens until it throws an ambiguous exception on the name given automatically by .NET.

This is also the same in my Master page. I have to add a classname and give it a random value.

I don't make any changes in the code behind.

Last edited by richyrich; May 30th, 2008 at 09:42 AM.
Reply With Quote
  #4  
Old May 30th, 2008, 09:52 AM
jmurrayhead's Avatar
The Barnfather

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 806
Thanks: 19
Thanked 74 Times in 71 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura about

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

Default

Typically, a master page would have the following directive:
Code:
<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>
I'm assuming that's something like what you started off with.

Post the main bits of your master page code behind file, leaving out anything you added after it was initially created.
Reply With Quote
  #5  
Old May 30th, 2008, 10:00 AM
richyrich's Avatar
Moderator


 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 395
Thanks: 26
Thanked 32 Times in 32 Posts
Blog Entries: 1
Rep Power: 1
richyrich will become famous soon enough

Awards Showcase
Classic ASP JavaScript 
Total Awards: 2

Default

Sorry J. Maybe I wasn't explaining this right.

I have a couple of custom controls that are included in some pages. The code I posted was the directive of one of the controls.

If I include the ClassName attribute in the directive with some random letters, it works until it throws the ambiguous exception again, normally when I upload a changed DAL, BLL or BOL file. If I then change the ClassName for some different random letters, it works again.

What I meant with regards to the master page was that once I get this error I get it for all the custom controls on the specifc page and the master page, so I have to change the random letters in the ClassName attribute of the directive for the controls and my Master page.

Then it works again.

Does that make more sense? What I was wondering was how to stop this error permanently.
Reply With Quote
  #6  
Old May 30th, 2008, 10:04 AM
jmurrayhead's Avatar
The Barnfather

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 806
Thanks: 19
Thanked 74 Times in 71 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura about

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

Default

It sounds like the temporary files are not clearing out which could be causing this problem. What is your development environment. Are you on IIS?

I believe there is a "Temporary ASP.Net Files" folder where your files are compiled to. You may have to manually clear this and see if it works.

Also, try clearing IE cache.
Reply With Quote
  #7  
Old May 30th, 2008, 10:10 AM
richyrich's Avatar
Moderator


 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 395
Thanks: 26
Thanked 32 Times in 32 Posts
Blog Entries: 1
Rep Power: 1
richyrich will become famous soon enough

Awards Showcase
Classic ASP JavaScript 
Total Awards: 2

Default

Yeah...IIS on a hosted server.

Would it be worth contacting my host and seeing if they can change anything?
Reply With Quote
  #8  
Old May 30th, 2008, 10:12 AM
jmurrayhead's Avatar
The Barnfather

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 806
Thanks: 19
Thanked 74 Times in 71 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura about

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

Default

Their system just might slow at updating files. I had that problem with my host, as well. It might do you better to develop and test locally and then upload to their server.
Reply With Quote
  #9  
Old May 30th, 2008, 10:23 AM
richyrich's Avatar
Moderator


 
Join Date: Mar 2008
Location: Somewhere only we know...
Posts: 395
Thanks: 26
Thanked 32 Times in 32 Posts
Blog Entries: 1
Rep Power: 1
richyrich will become famous soon enough

Awards Showcase
Classic ASP JavaScript 
Total Awards: 2

Default

Tried it locally, but it won't connect to any of the MySQL servers. Just says:-
Unable to connect to any of the specified MySQL hosts

Can't think why as I use a fully qualified domain for the Data Source.

Last edited by richyrich; May 30th, 2008 at 10:26 AM.
Reply With Quote
  #10  
Old May 30th, 2008, 10:29 AM
jmurrayhead's Avatar
The Barnfather

 
Join Date: Mar 2008
Location: Reston, VA, USA
Posts: 806
Thanks: 19
Thanked 74 Times in 71 Posts
Blog Entries: 5
Rep Power: 3
jmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura aboutjmurrayhead has a spectacular aura about

Awards Showcase
Microsoft .Net Microsoft SQL Server Microsoft Windows Classic ASP 
Total Awards: 4

Default

Quote:
Originally Posted by richyrich View Post
Tried it locally, but it won't connect to any of the MySQL servers. Just says:-
Unable to connect to any of the specified MySQL hosts

Can't think why as I use a fully qualified domain for the Data Source.
See the last post here regarding this:

Unable to connect to any of the specified MySQL hosts - ASP.NET Forums
Reply With Quote
Reply

  DeveloperBarn Forums > Programming & Scripting > .Net Development

Bookmarks

Tags
ambiguous, namespace

Thread Tools
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
class name is ambiguous richyrich .Net Development 11 August 12th, 2008 11:11 AM


All times are GMT -4. The time now is 08:20 AM.



Content Relevant URLs by vBSEO 3.2.0