473,473 Members | 1,955 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Missing directive or assembly reference?

2 New Member
Expand|Select|Wrap|Line Numbers
  1.  private void okButton_Click(object sender, EventArgs e)
  2.         {
  3.             HelloForm aHelloForm = new HelloForm();
  4.             aHelloForm.Show();
  5.  
  6.         }
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.
Dec 13 '10 #1
2 4768
GaryTexmo
1,501 Recognized Expert Top Contributor
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.
Dec 13 '10 #2
Brandon S
2 New Member
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.
Dec 13 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Ray | last post by:
<%@ Import Namespace="System.Windows.Forms"% I got this error message. I searched System.windows.Forms, I found the dll file in the c:\programfiles\visual studio.. It is only 1 137kb size....
1
by: Rob Lamb | last post by:
Please can someone tell me WHY I would be getting this error and secondly HOW to resolve it. Regards Rob
1
by: Meir | last post by:
Hello, I'm new in C# and .net, I'm doing the Walkthrough: Creating a Web User Control that comes with Visual Studio .Net 2003. In this Walkthrough you create a User Control and call it from a...
0
by: RSB | last post by:
Hi every one, all of a sudden my project has started giving me the errors about the Reference. here is one example. C:\Projects\myMainFile.ascx.cs(3): A using namespace directive can only be...
2
by: PL | last post by:
According to the documentation I'm supposed to be able to use any classes in the ..NET framework inside a msxml:script block if I use a fully qualified path. I'm trying to test the XSL sheet...
5
by: Greg Collins [MVP] | last post by:
I have an ASP.NET page that uses a tag: <asp:Xml id="foo" runat="server" DocumentSource="rss.xml" TransformSource="rss20.xsl" /> This creates a Web page from an XML file that was generated by...
0
by: li.eddie | last post by:
Hi All, I'm new to ASP.NET and trying to create a Database application with MS Visual Web Dev 2005. In my project, I wrote a generic abstract class called DataAccessHelper.cs under App_Code folder...
5
by: rcoco | last post by:
Hi, I have this program that I'm trying to compile and it flags this error: The type or namespace name 'src' could not be found(are you missing a using directive or an assembly reference?) I've...
4
by: =?Utf-8?B?V2FubmFiZQ==?= | last post by:
I developed, and ran successfully, a web application on my development box, but cannot get it to run on the server. The error I am getting is: Compiler Error Message: CS0234: The type or...
2
by: m.a | last post by:
Hello, I have the following code which is an entity for a table in my database. but I am getting several errors such as: The type or namespace name 'ColumnAttribute' could not be found (are...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.