none
Import statement with alias - ambiguity between a namespace and a class RRS feed

  • Question

  • This may not belong in the CLR forum, but I could't find a better one.
    Is anyone able to explain how to resolve an ambiguity between a namespace and a class when doing an import using an alias?
    In the managed directx library, there is a Microsoft.DirectX.DirectDraw class, and a namespace by the same name.
    When I do;
    Imports DirectDraw = Microsoft.DirectX.DirectDraw, I end up with the class being aliased.  I would like the namespace to be aliased. 

    Collin Sauve
    Saturday, May 30, 2009 1:56 AM

Answers

  • Hmm, I don't see that problem.  There is indeed a Microsoft.DirectX.DirectDraw namespace but not any class with a name like DirectDraw.  Maybe you created your own class with that name in your own namespace?  Just rename it.  Or spell out the full class name, global::Microsoft.DirectX.DirectDraw.Mumble.

    Hans Passant.
    • Marked as answer by Collin Sauve Saturday, May 30, 2009 5:10 PM
    Saturday, May 30, 2009 10:34 AM
    Moderator

All replies

  • Hmm, I don't see that problem.  There is indeed a Microsoft.DirectX.DirectDraw namespace but not any class with a name like DirectDraw.  Maybe you created your own class with that name in your own namespace?  Just rename it.  Or spell out the full class name, global::Microsoft.DirectX.DirectDraw.Mumble.

    Hans Passant.
    • Marked as answer by Collin Sauve Saturday, May 30, 2009 5:10 PM
    Saturday, May 30, 2009 10:34 AM
    Moderator
  • Ya you're probably right.  Right now I'm not sure what it was, I am actually now getting the namespace like I wanted.  That's probably what it was.

    Collin Sauve
    Saturday, May 30, 2009 5:09 PM