472,354 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 software developers and data experts.

Application.Run

I am new to VS2005.

I changed my program.cs file to be a different form I am working on. But
when I go to run the application it still brings up the form that was
originally declared as new. When I put in a break point the program does
not stop. It is in debug mode. If I change the program.cs file back to the
form that was originally being used. The program does go into debug mode.
But if I change code in that file it isn't using it. It is like the program
is using an old compiled version.

Any one know why this would be?

TIA,
Brett
Oct 25 '06 #1
9 4493
Ok after sending this and reading it I didn't really describe what I was
trying to accomplish. Sorry about that.

I just want to change the start up form. I did look under the
projects-application properties but there is nothing to change. I would
expect it to be in the start up object but all that was there was
ProgramName.Program so I am assuming it is calling the program.cs class.
That is where I change teh Application.Run to be the different form.

So I guess am I evern looking in the right place to change the startup form?

TIA,
Brett

"Brett Wesoloski" <br*************@kcc.omwrote in message
news:12*************@corp.supernews.com...
>I am new to VS2005.

I changed my program.cs file to be a different form I am working on. But
when I go to run the application it still brings up the form that was
originally declared as new. When I put in a break point the program does
not stop. It is in debug mode. If I change the program.cs file back to
the form that was originally being used. The program does go into debug
mode. But if I change code in that file it isn't using it. It is like the
program is using an old compiled version.

Any one know why this would be?

TIA,
Brett

Oct 25 '06 #2
The form that is first shown when an application is run is usually the form
that is passed as the parameter to

Application.Run();

The first "Application.Run" called will be the first Application.Run called
after the method "Main".

Main is ALWAYS the first method that is run it's signature is (in a
WindowsApplication):

static void Main()
{

}

You cannot declare more than 1 "main" method or the compiler will whinge.

Look for the method "main" and you will find the first Application.Run()

Jax

"Brett Wesoloski" wrote:
Ok after sending this and reading it I didn't really describe what I was
trying to accomplish. Sorry about that.

I just want to change the start up form. I did look under the
projects-application properties but there is nothing to change. I would
expect it to be in the start up object but all that was there was
ProgramName.Program so I am assuming it is calling the program.cs class.
That is where I change teh Application.Run to be the different form.

So I guess am I evern looking in the right place to change the startup form?

TIA,
Brett

"Brett Wesoloski" <br*************@kcc.omwrote in message
news:12*************@corp.supernews.com...
I am new to VS2005.

I changed my program.cs file to be a different form I am working on. But
when I go to run the application it still brings up the form that was
originally declared as new. When I put in a break point the program does
not stop. It is in debug mode. If I change the program.cs file back to
the form that was originally being used. The program does go into debug
mode. But if I change code in that file it isn't using it. It is like the
program is using an old compiled version.

Any one know why this would be?

TIA,
Brett


Oct 25 '06 #3
Brett,

So you're saying that you did change the Application.Run line in the
static Main method? That should have worked. Can you post the code
from the Main method?

Brian

Brett Wesoloski wrote:
Ok after sending this and reading it I didn't really describe what I was
trying to accomplish. Sorry about that.

I just want to change the start up form. I did look under the
projects-application properties but there is nothing to change. I would
expect it to be in the start up object but all that was there was
ProgramName.Program so I am assuming it is calling the program.cs class.
That is where I change teh Application.Run to be the different form.

So I guess am I evern looking in the right place to change the startup form?

TIA,
Brett

"Brett Wesoloski" <br*************@kcc.omwrote in message
news:12*************@corp.supernews.com...
I am new to VS2005.

I changed my program.cs file to be a different form I am working on. But
when I go to run the application it still brings up the form that was
originally declared as new. When I put in a break point the program does
not stop. It is in debug mode. If I change the program.cs file back to
the form that was originally being used. The program does go into debug
mode. But if I change code in that file it isn't using it. It is like the
program is using an old compiled version.

Any one know why this would be?

TIA,
Brett
Oct 25 '06 #4
Ok well in the program.cs class I have

static void Main()

{

Application.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(fals e);

Application.Run(new Login());

}

I have changed Applicaiton.Run() from

Application.Run(new Login());

to

Applicaiton.Run(new ShelfList()):

but it still brings up the Login screen. Also I can not debug the
application any more. If I leave it Login() then I can debug the app and it
goes to the Application.Run(new Login()); then brings up the form. So I
thought it would be as easy as changing the Login() to ShelfList()

It seems from what you are saying I was looking/working in the correct spot.

Any other idea's?

TIA,
Brett

"UhihaJax" <Uh******@discussions.microsoft.comwrote in message
news:65**********************************@microsof t.com...
The form that is first shown when an application is run is usually the
form
that is passed as the parameter to

Application.Run();

The first "Application.Run" called will be the first Application.Run
called
after the method "Main".

Main is ALWAYS the first method that is run it's signature is (in a
WindowsApplication):

static void Main()
{

}

You cannot declare more than 1 "main" method or the compiler will whinge.

Look for the method "main" and you will find the first Application.Run()

Jax

"Brett Wesoloski" wrote:
>Ok after sending this and reading it I didn't really describe what I was
trying to accomplish. Sorry about that.

I just want to change the start up form. I did look under the
projects-application properties but there is nothing to change. I would
expect it to be in the start up object but all that was there was
ProgramName.Program so I am assuming it is calling the program.cs class.
That is where I change teh Application.Run to be the different form.

So I guess am I evern looking in the right place to change the startup
form?

TIA,
Brett

"Brett Wesoloski" <br*************@kcc.omwrote in message
news:12*************@corp.supernews.com...
>I am new to VS2005.

I changed my program.cs file to be a different form I am working on.
But
when I go to run the application it still brings up the form that was
originally declared as new. When I put in a break point the program
does
not stop. It is in debug mode. If I change the program.cs file back
to
the form that was originally being used. The program does go into
debug
mode. But if I change code in that file it isn't using it. It is like
the
program is using an old compiled version.

Any one know why this would be?

TIA,
Brett



Oct 25 '06 #5
Yes I did change the Application.Run line in the static Main method.

Here is my main code.

static void Main()

{

Application.EnableVisualStyles();

Application.SetCompatibleTextRenderingDefault(fals e);

Application.Run(new Login());

}

If I change Applicaiton.Run(new ShelfList()); then it doesn't work. Just
bypasses the code and brings up the Login().

Under the project properties - Applicaiton I have for startup object I have
programName.Program.
I have done a search through the whole project for another Main method but
nothing.

TIA,
Brett

"Brian Gideon" <br*********@yahoo.comwrote in message
news:11*********************@e3g2000cwe.googlegrou ps.com...
Brett,

So you're saying that you did change the Application.Run line in the
static Main method? That should have worked. Can you post the code
from the Main method?

Brian

Brett Wesoloski wrote:
>Ok after sending this and reading it I didn't really describe what I was
trying to accomplish. Sorry about that.

I just want to change the start up form. I did look under the
projects-application properties but there is nothing to change. I would
expect it to be in the start up object but all that was there was
ProgramName.Program so I am assuming it is calling the program.cs class.
That is where I change teh Application.Run to be the different form.

So I guess am I evern looking in the right place to change the startup
form?

TIA,
Brett

"Brett Wesoloski" <br*************@kcc.omwrote in message
news:12*************@corp.supernews.com...
>I am new to VS2005.

I changed my program.cs file to be a different form I am working on.
But
when I go to run the application it still brings up the form that was
originally declared as new. When I put in a break point the program
does
not stop. It is in debug mode. If I change the program.cs file back
to
the form that was originally being used. The program does go into
debug
mode. But if I change code in that file it isn't using it. It is like
the
program is using an old compiled version.

Any one know why this would be?

TIA,
Brett

Oct 25 '06 #6
Well I created a new project and was able to change it.

Something must have been messed up with the project.

Thanks,
Brett
"Brett Wesoloski" <br*************@kcc.omwrote in message
news:12*************@corp.supernews.com...
>I am new to VS2005.

I changed my program.cs file to be a different form I am working on. But
when I go to run the application it still brings up the form that was
originally declared as new. When I put in a break point the program does
not stop. It is in debug mode. If I change the program.cs file back to
the form that was originally being used. The program does go into debug
mode. But if I change code in that file it isn't using it. It is like the
program is using an old compiled version.

Any one know why this would be?

TIA,
Brett

Oct 25 '06 #7
Something was massively out of sync, were you running it from F5 in Visual
Studio or running the .exe and attaching the debugger?

If the debugger skips through the breakpoints thats a sure sign that what
you are debugging with and what you are debugging against do not match.

"Brett Wesoloski" <br*************@kcc.omwrote in message
news:12*************@corp.supernews.com...
Well I created a new project and was able to change it.

Something must have been messed up with the project.

Thanks,
Brett
"Brett Wesoloski" <br*************@kcc.omwrote in message
news:12*************@corp.supernews.com...
I am new to VS2005.

I changed my program.cs file to be a different form I am working on.
But
when I go to run the application it still brings up the form that was
originally declared as new. When I put in a break point the program
does
not stop. It is in debug mode. If I change the program.cs file back to
the form that was originally being used. The program does go into debug
mode. But if I change code in that file it isn't using it. It is like
the
program is using an old compiled version.

Any one know why this would be?

TIA,
Brett


Oct 25 '06 #8
This is often just because debug files get messed up. This happens
sometimes for no apparent reason and is nowhere near dangerous. Delete
*.pdb from Debug\bin, recompile the whole project, and try again.
Stephan
Simon Tamman wrote:
Something was massively out of sync, were you running it from F5 in Visual
Studio or running the .exe and attaching the debugger?

If the debugger skips through the breakpoints thats a sure sign that what
you are debugging with and what you are debugging against do not match.

"Brett Wesoloski" <br*************@kcc.omwrote in message
news:12*************@corp.supernews.com...
Well I created a new project and was able to change it.

Something must have been messed up with the project.

Thanks,
Brett
"Brett Wesoloski" <br*************@kcc.omwrote in message
news:12*************@corp.supernews.com...
>I am new to VS2005.
>
I changed my program.cs file to be a different form I am working on.
But
when I go to run the application it still brings up the form that was
originally declared as new. When I put in a break point the program
does
not stop. It is in debug mode. If I change the program.cs file back to
the form that was originally being used. The program does go into debug
mode. But if I change code in that file it isn't using it. It is like
the
program is using an old compiled version.
>
Any one know why this would be?
>
TIA,
Brett
>
Oct 25 '06 #9
Another thing to try is to clean the solution. To do this, go to the
"Build" menu and select "clean solution". Then rebuild the solution and
try running. Just a thought.

ssamuel wrote:
This is often just because debug files get messed up. This happens
sometimes for no apparent reason and is nowhere near dangerous. Delete
*.pdb from Debug\bin, recompile the whole project, and try again.
Stephan
Simon Tamman wrote:
Something was massively out of sync, were you running it from F5 in Visual
Studio or running the .exe and attaching the debugger?

If the debugger skips through the breakpoints thats a sure sign that what
you are debugging with and what you are debugging against do not match.

"Brett Wesoloski" <br*************@kcc.omwrote in message
news:12*************@corp.supernews.com...
Well I created a new project and was able to change it.
>
Something must have been messed up with the project.
>
Thanks,
Brett
"Brett Wesoloski" <br*************@kcc.omwrote in message
news:12*************@corp.supernews.com...
I am new to VS2005.

I changed my program.cs file to be a different form I am working on.
But
when I go to run the application it still brings up the form that was
originally declared as new. When I put in a break point the program
does
not stop. It is in debug mode. If I change the program.cs file back to
the form that was originally being used. The program does go into debug
mode. But if I change code in that file it isn't using it. It is like
the
program is using an old compiled version.

Any one know why this would be?

TIA,
Brett

>
>
Oct 25 '06 #10

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

Similar topics

9
by: J. Baute | last post by:
I'm caching data in the Application object to speed up certain pages on a website The main reason is that the retrieval of this data takes quite a while (a few seconds) and fetching the same data...
3
by: Amit Dedhia | last post by:
Hi I am developing a Dot net application (involving image processing) on a uni processor. It works well on my machine. I then take all my code on a multi processor, build and run the application...
6
by: orekin | last post by:
Hi There I have been trying to come to grips with Application.Run(), Application.Exit() and the Message Pump and I would really appreciate some feedback on the following questions .. There are...
20
by: Peter Oliphant | last post by:
How does one launch multiple forms in an application? Using Photoshop as an example, this application seems to be composed of many 'disjoint' forms. Yet, they all seem somewhat 'active' in...
6
by: Josef Brunner | last post by:
Hi, I published my application (VS 2005) and am now trying to install it when I get this error message. It worked before...even on a different machine. Here is the detailed description: ...
9
by: jeff | last post by:
Hi All. I realize that when my Deployed winforms application starts, Windows needs to load the .net 2 framework before control is given to my application.... Is there anyway to either ... -...
3
by: asadikhan | last post by:
Hi, I have written a windows application with a GUI (let's call it MENU). I own the code for this application and have access to it. We have another application that is a third-part windows...
2
by: Michael Kalika | last post by:
Hi, We have developed a VSTO 2005 Excel application and we would like to leverage ClickOnce deployment mechanism for distribution of this application. How can we do that? I was digging in MSDN...
0
by: Tifer | last post by:
Hello, I am building my first .Net Application. The first couple of Publish and Installs I did went fine. But after a couple of builds, I get a modal dialogue box error every time upon trying...
4
by: Dave | last post by:
I have a global.asax file with Application_Start defined and create some static data there and in another module used in the asp.net application and I realize that static data is shared amongst...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made but the http to https rule only works for...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...

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.