Tanasoo

Hi, I just started working with C# and I am having a little problem. When I hit debug (F5) it will compile and seem to work fine, but it will not launch the form window. However if run without debugging (Ctrl + F5) it will launch the window and everything will work fine. It will also not launch the form if I try and step through the app. It will step through just fine until the line where it launches the form, and then it will stop.

Has anyone had this problem Is it just something I need to change in the settings

Also, My programing experience mostly comes from using scripts in 3D packages, the language was pretty similar to C# so I have a good start, but there was one feature that I'm wondering exists in C#. When coding in script, I could enter a variable in the console and it would output the value assigned to it. This was extremely useful for debugging purposes. Is there anyway to see the values assigned to variables in C#

Thanks!



Re: Visual C# Express Edition Quick questions about C# Express

jrboddie

Tanasoo,

What you are describing sounds like a common situation when developing a Console Application. Is that what you are doing If so, the common practice is to use a Console.ReadLine(); statement at the end of your code to stop the console from disappearing when using debug mode.

Regarding your question about looking at variables, Visual Studio has some nice features.

1. When the code has stopped at a breakpoint, you can hover the mouse pointer over a variable name and see its current value.

2. Menu item Debug > Windows > Locals will display a list of local variables and their values.

3. Menu item Debug > Windows > Watch will display a panel in which you can specify variables to watch during single stepping.

4. Menu item Debug > Windows > Immediate will give you a console to set variable values while single stepping.





Re: Visual C# Express Edition Quick questions about C# Express

Tanasoo

Thanks for the reply. I'm actually running a windows application (With GUI). I also have this problem with any sample scripts I try and run. Although sometimes it looks like the window flashes up for a half a second or so, it's hardly noticeable and doesnt happen all the time. Again, it works fine if I ren without debugging, but when ever I try and use any of the debugging features it will not open (or stay open).





Re: Visual C# Express Edition Quick questions about C# Express

Tanasoo

I think I found the problem...

Under the application properties and Debug, there is a checkbox labeled "Enable the Visual Studio hosting process". If I unchecked that box it will launch the window when I hit debug. Any reason why having this on would make the window not launch





Re: Visual C# Express Edition Quick questions about C# Express

Jeremy Meng MSFT

Tanasoo wrote:

Hi, I just started working with C# and I am having a little problem. When I hit debug (F5) it will compile and seem to work fine, but it will not launch the form window. However if run without debugging (Ctrl + F5) it will launch the window and everything will work fine. It will also not launch the form if I try and step through the app. It will step through just fine until the line where it launches the form, and then it will stop.

Has anyone had this problem Is it just something I need to change in the settings

Also, My programing experience mostly comes from using scripts in 3D packages, the language was pretty similar to C# so I have a good start, but there was one feature that I'm wondering exists in C#. When coding in script, I could enter a variable in the console and it would output the value assigned to it. This was extremely useful for debugging purposes. Is there anyway to see the values assigned to variables in C#

Thanks!

Hi Tanasoo,

I created a default WinForm application and tried hitting F5 in both cases. The win form showed regardless whether or not the option is checked in Project properties | Debug tab. Does the problem happend to you when you create a default WinForm app and only toggle the option

@ the second question. There's a debug window called Immediate Window, which is under Debug | Windows | Immediate (default keybinding Ctrl+D, I). It might be the thing you are looking for.

Thanks,






Re: Visual C# Express Edition Quick questions about C# Express

BenDesc

I am having the same problem. When I hit debug the windows form is not showing up. I have no idea of what to do. I have tried re-installing the program and that is not working. Is it just a setting that needs to be changed or what Thanks in advance for the help