Problem with namespaces/references
-
I have a solution that contains 4 projects. The main project is entitled Majo, which uses the Majo namespace IE: namespace Majo { public class Majo : System.Windows.Forms.Form { ... In the Components project I have the following declaration: namespace Majo { namespace Components { public class ImageComponent : PictureBox { .... The problem is I need to have access to the Majo class within the main Majo namespace, but if I just use Majo from the Components namespace, I get a 'Majo' denotes a 'namespace' where a 'class' was expected How can I gain access to the Majo class from Components? Thanks.
-
I have a solution that contains 4 projects. The main project is entitled Majo, which uses the Majo namespace IE: namespace Majo { public class Majo : System.Windows.Forms.Form { ... In the Components project I have the following declaration: namespace Majo { namespace Components { public class ImageComponent : PictureBox { .... The problem is I need to have access to the Majo class within the main Majo namespace, but if I just use Majo from the Components namespace, I get a 'Majo' denotes a 'namespace' where a 'class' was expected How can I gain access to the Majo class from Components? Thanks.
Majo.Majo majo = new Majo(); IMO you'd do better to change the namespace name, it's potentially confusing. Christian Graus - Microsoft MVP - C++
-
Majo.Majo majo = new Majo(); IMO you'd do better to change the namespace name, it's potentially confusing. Christian Graus - Microsoft MVP - C++
I still get a The type or namespace name 'Majo' does not exist in the class or namespace 'Majo' (are you missing an assembly reference?) error if I attempt to use Majo.Majo. Is there someone I have to do to be able to reference the main class?
-
I still get a The type or namespace name 'Majo' does not exist in the class or namespace 'Majo' (are you missing an assembly reference?) error if I attempt to use Majo.Majo. Is there someone I have to do to be able to reference the main class?
methodincharge wrote: Is there someone I have to do LOL - I assume this is a typo. I would still recommend changing the namespace name. Other than that, it's a strange problem, I'd expect it to work that out for you. Christian Graus - Microsoft MVP - C++