+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: ambiguous in the namespace 'ASP'

  1. #1
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    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?

  2. #2
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    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, give me rep.
    If you like it here...throw us a few bones to help support us.


  3. #3
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    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 10:42 AM.

  4. #4
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    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.
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  5. #5
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    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.

  6. #6
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    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.
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  7. #7
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    Yeah...IIS on a hosted server.

    Would it be worth contacting my host and seeing if they can change anything?

  8. #8
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    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.
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


  9. #9
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    3,207
    Blog Entries
    14
    Real Name
    Rich
    Rep Power
    14

    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 11:26 AM.

  10. #10
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Reston, VA
    Posts
    4,547
    Blog Entries
    9
    Real Name
    Jason
    Rep Power
    22

    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
    jmurrayhead
    If you agree, give me rep.
    If you like it here...throw us a few bones to help support us.


+ Reply to Thread
Page 1 of 2 1 2 LastLast

Similar Threads

  1. class name is ambiguous
    By richyrich in forum .NET Development
    Replies: 11
    Last Post: August 12th, 2008, 12:11 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO by vBSEO