473,508 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The type or namespace name "Application" could not be found

Hi,
I am a beginner in .NET.
I am creating a new project. At begin I created this project with a form,
then a class."start"
I want to use class "start" as start point for this program. In this class I
wrote:
[STAThread]

static void Main()

{

Application.Run(new start());

}

But I can not build, compile the project, the error is:
The type or namespace name "Application" could not be found

What can I do?

Thanks
Nhan
Nov 16 '05 #1
6 18427
Le, Thanh-Nhan <le*****@freenet.de> wrote:
I am a beginner in .NET.
I am creating a new project. At begin I created this project with a form,
then a class."start"
I want to use class "start" as start point for this program. In this class I
wrote:
[STAThread]

static void Main()

{

Application.Run(new start());

}

But I can not build, compile the project, the error is:
The type or namespace name "Application" could not be found

What can I do?


Make sure you have "using System.Windows.Forms;" in your list of using
directives.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
psg
"Le, Thanh-Nhan" <le*****@freenet.de> wrote in message
news:uC**************@TK2MSFTNGP14.phx.gbl...
The type or namespace name "Application" could not be found


Application is a member of System.Windows.Forms namespace.
So You need to add
"using System.Windows.Forms;" line at the beginning
or change Your line to
"System.Windows.Forms.Application.Run(new start());"

Additionally You may need to add "System.Windows.Forms.dll" to Your project
references.

RGDS PSG
Nov 16 '05 #3
I have now the line:
using System.Windows.Forms;

then I have the compile error: "The best overloaded method match for
"System.Windows.Forms.Application.Run(System.Windo ws.Forms)" has some
invalid
argument"

OK, I can understand, the object parameter must be a form object, my "start"
class is any form, is only a normal class.
How can I do? Is it possible, to use a normal class (as in java, or VB6) as
start point for a program?

Nhan

"Jon Skeet [C# MVP]" <sk***@pobox.com> schrieb im Newsbeitrag
news:MP************************@msnews.microsoft.c om...
Le, Thanh-Nhan <le*****@freenet.de> wrote:
I am a beginner in .NET.
I am creating a new project. At begin I created this project with a form, then a class."start"
I want to use class "start" as start point for this program. In this class I wrote:
[STAThread]

static void Main()

{

Application.Run(new start());

}

But I can not build, compile the project, the error is:
The type or namespace name "Application" could not be found

What can I do?


Make sure you have "using System.Windows.Forms;" in your list of using
directives.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 16 '05 #4
Thanks
please see my posting to Jon Skeet
Nhan
"psg" <pg******@ki.net.pl> schrieb im Newsbeitrag
news:cq**********@b177.ki.net.pl...
"Le, Thanh-Nhan" <le*****@freenet.de> wrote in message
news:uC**************@TK2MSFTNGP14.phx.gbl...
The type or namespace name "Application" could not be found
Application is a member of System.Windows.Forms namespace.
So You need to add
"using System.Windows.Forms;" line at the beginning
or change Your line to
"System.Windows.Forms.Application.Run(new start());"

Additionally You may need to add "System.Windows.Forms.dll" to Your

project references.

RGDS PSG

Nov 16 '05 #5
psg
"Le, Thanh-Nhan" <le*****@freenet.de> wrote in message
news:Os**************@TK2MSFTNGP11.phx.gbl...
OK, I can understand, the object parameter must be a form object
Yes one of options is Form.
my "start" class is any form, is only a normal class.
How can I do? Is it possible, to use a normal class (as in java, or VB6)
as
start point for a program?


In a Main function You can Initialize Your "start" class ("start myStart =
new start();") and run its methods or if start() is only a method/function
of current class You can run it through e.g. "start();"

RGDS PSG

Nov 16 '05 #6
OK, thanks.

in Main function (static void Main() ) I call: start app = new start();
then in contructor of class start, I do everything.

"psg" <pg******@ki.net.pl> schrieb im Newsbeitrag
news:cq**********@b177.ki.net.pl...
"Le, Thanh-Nhan" <le*****@freenet.de> wrote in message
news:Os**************@TK2MSFTNGP11.phx.gbl...
OK, I can understand, the object parameter must be a form object


Yes one of options is Form.
my "start" class is any form, is only a normal class.
How can I do? Is it possible, to use a normal class (as in java, or VB6)
as
start point for a program?


In a Main function You can Initialize Your "start" class ("start myStart =
new start();") and run its methods or if start() is only a method/function
of current class You can run it through e.g. "start();"

RGDS PSG

Nov 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
16140
by: Microsoft | last post by:
I'm trying to display a word document inside a web page, but everytime I do I get this error: Error Type: Microsoft VBScript runtime (0x800A0046) Permission denied: 'CreateObject' Does...
0
1273
by: Benjamin Butz | last post by:
Starting our application I get this error "File or assembly name xxx.dll, or one of its dependencies, was not found." The filename xxx.dll changes every start (i.e. eb5mq-ng.dll, akttbvik,dll,...
4
2061
by: Julie | last post by:
I stumbled across Application from someone else's code, and I can't find out squat about by searching MS, Google, or Google Groups. For the most part, this is returning the fully-qualified name...
3
11783
by: Gustavo L. Fabro | last post by:
Greetings! I'm testing VS 2005 Beta 2, and I've compiled a program that runs just fine on my computer (where VS is installed). I've tried to run this same program on another computer (after...
0
1197
by: clv | last post by:
Hello: I need to rescue the value of a variable type application from a file ".vb", when making "j = Application("test")" throws an error to me, if I the same make from a pagina aspx I do not...
2
5640
by: Arjen | last post by:
Hello, I want to check if an directory exist. Directory.Exists(Application + "/Uploads/") I'm doing this inside a asp.net web project in a class file. Here is the error message. The name...
13
5054
by: Bob Day | last post by:
Using vs2003, vb.net I start a thread, giving it a name before start. Code snippet: 'give each thread a unique name (for later identification) Trunk_Thread.Name = "Trunk_0_Thread" ' allow...
13
2280
by: Kobee | last post by:
Hi, I'm having a few issues adapting to new 2.0 "website" project vs. the old 1.1 "web application". One of the major issues I'm having is with the notion of namespaces. Using the old way, I...
0
1600
by: clintonb | last post by:
I converted a Web Site project to a Web Application project using the instructions found on this page: http://webproject.scottgu.com/CSharp/Migration2/Migration2.aspx One thing I did differently...
0
7225
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
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7498
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
5627
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,...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3194
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
766
muto222
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.