using statement not having any effect

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

This is a very strange bug (I think it's a bug)

I have a class:
Test.MyNamespace
public class MyClass
public static int GetNumber();


Then in another class I have added the using statement like this:
using Test.MyNamespace;


Then later I use the above class
int i = MyClass.GetNumber();


This give a "The type or namspace name 'GetNumber' does not exist in the
namespace 'MyClass'...."


Here is the weird part. If I call it like this:
int i = Test.MyNamespace.MyClass.GetNumber();


It works fine. Gremlins.
Anyone seen this? I have tried rebuilding, restarting and rebooting. Makes
no difference.
 
Hi Stev
I think you have another namespace with the name of MyClass. So the
compiler expects GetNumber one of member of a namespace


Can you post a copy of your code
Best Regards,
A.Hadi
 
Hi,

You have some name conflicts , do a search of "MyClass" see if you have by
anychance a namespace named like that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top