As part of my intro to C# class I'm working on multiform project. However, while trying to use the general form of the show method above, I'm getting the error Error 2 The type or namespace name 'HelloForm' could not be found (are you missing a using directive or an assembly reference?) and can't seem to resolve it. I'm using Visual Studio C# Express and have already added the HelloForm to the project from the 'add existing item' option. What am I doing wrong? My instructor is not very good at solving errors like this.
Error 2 The type or namespace name 'HelloForm' could not be found (are you missing a using directive or an assembly reference?)
I'm willing to bet you're missing a using directive. Once you add the assembly reference, you also need a using statement at the top so your program knows what namespace the control lives in.
Alternatively, you could use the fully qualified name, which is the namespace followed by the object, to declare it.
You'll have to find out what the namespace is, then put a using directive at the top of your code file.
Thanks a million man. At first I had no idea what you meant but did some further research to understand it better, and I was able to resolve it. I was missing a using directive (which I am now more familiar with) and can now continue my project.
Comment