473,665 Members | 2,827 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The type or namespace name "Applicatio n" 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 "Applicatio n" could not be found

What can I do?

Thanks
Nhan
Nov 16 '05 #1
6 18449
Le, Thanh-Nhan <le*****@freene t.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 "Applicatio n" 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.co m>
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*****@freene t.de> wrote in message
news:uC******** ******@TK2MSFTN GP14.phx.gbl...
The type or namespace name "Applicatio n" 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.Applicat ion.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.Applicat ion.Run(System. Windows.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.co m> schrieb im Newsbeitrag
news:MP******** *************** *@msnews.micros oft.com...
Le, Thanh-Nhan <le*****@freene t.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 "Applicatio n" 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.co m>
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.ne t.pl> schrieb im Newsbeitrag
news:cq******** **@b177.ki.net. pl...
"Le, Thanh-Nhan" <le*****@freene t.de> wrote in message
news:uC******** ******@TK2MSFTN GP14.phx.gbl...
The type or namespace name "Applicatio n" 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.Applicat ion.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*****@freene t.de> wrote in message
news:Os******** ******@TK2MSFTN GP11.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.ne t.pl> schrieb im Newsbeitrag
news:cq******** **@b177.ki.net. pl...
"Le, Thanh-Nhan" <le*****@freene t.de> wrote in message
news:Os******** ******@TK2MSFTN GP11.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
16169
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 anybody know the correct way to do this? I don't want to link to a document, but rather display a word file inside the asp page.
0
1283
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, ...). It's a managed code application. The error occurs only on two computers. On a lot computers (#> 100) it works. Does anybody have any suggestions? Thank you
4
2064
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 of the server and path to my application, such as: http://devserver/testapp However, on 1 of my test servers, it returns:
3
11805
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 having installed MS .NET Framework 2.0 Beta 2 on it, from http://www.microsoft.com/downloads/details.aspx?FamilyId=7ABD8C8F-287E-4C7E-9A4A-A4ECFF40FC8E&displaylang=en), but got the following message:
0
1204
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 have problems. as I must do it? it is possible to do it? Claudio Lemus
2
5647
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 'Application' does not exist in the class or namespace.
13
5073
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 only 1 thread per line Trunk_Thread.ApartmentState = ApartmentState.STA
13
2295
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 could add a directory to my project (say, "Controls"), then add a user control to that directory. From an .aspx I could then import the namespace ("using .Controls";), and then reference that control. With the 2.0 way of doing things, if I add a...
0
1606
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 is that I made an empty ASP.NET AJAX- Enabled Web Application instead of an ASP.NET Web Application. Before converting, there were some classes in the App_Code folder. After converting, the folder was renamed Old_App_Code. But now I get...
0
8438
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8863
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8779
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8549
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4356
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2765
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 we have to send another system
2
2004
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1761
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.