Namespace being Shadowed?

tradnbillies

Member
Joined
Jun 2, 2005
Messages
12
Location
Meriden, CT & Willington, CT
Programming Experience
3-5
I'm having a problem compiling a visual studio 2005 Web Application project due to some namespace issues, and have no idea where to go with this...

I am working with code that was written by someone else, and runs fine "standalone" as a web app, but I am working to put the code into a solution, yet am having an impossible time compiling this.

Here is my situation...

I have a C# code file that contains one class, fully defined as "Sync.Util.MimeType" - I am manually building this C# file into a .dll and referencing it in my Web Application.

I have a VB code file that I want to be included in my solution so I can get all the benefits of VS. This code file uses the "MimeType" class, and has no problem seeing it under the simplest of examples... the reference to "MimeType" occurs in a class called "Common". My problem is when I try to put the "Common" class into the "Sync.Data" namespace, I can no longer declare a variable as "Sync.Util.Mimetype" - it is not a defined class.

This code works:
VB.NET:
Class Common
   Private d As Sync.Util.Mimetype
End Class

This code doesn't:
VB.NET:
Namespace Sync.Data
   Class Common
      Private d As Sync.Util.Mimetype 'Sync.Util.Mimetype is undefined here
   End Class
End Namespace

At the top of the "Common" file, I can use "Imports Sync.Util", but as soon as I'm in the "Sync.Data" namespace, I can no longer see "Sync.Util".

Please help.

I'd like to make this work as painlessly as possible and without changing a lot of code if possible. It obviously works if all these .dll's are compiled and dropped into the /bin folder, but Visual Studio won't compile if I want to put these in a solution.

Thanks...
 
hmm... based on your question, I attempted to move the namespace of the project I was working in, and it seemed to clear up the problem. Is there a reason this is the case?

Was one "Sync" being defined as "Sync.*" while the other was being defined as "IFWebsite.Sync.*" and the IDE saw those as different namespaces...?
 
Back
Top