Debug a compiled program? c# wpf [closed] - c#

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
i am currently developing an alternate shell for windows( to be replaced with explorer).
the problem is the program runs fine when run as a normal executable.
but when i set it as default shell for windows and re-log in into my user account the program runs for a few seconds and then it force closes.
is there anything i can do what might be going wrong?
BTW working on c# wpf.

You are always debugging a compiled program.
However, when you run it from Visual Studio, the debugger is automatically attached (so you can see exceptions, set breakpoints, etc).
You can do the same thing to an already running process by using the "Attach to Process" option in the "Debug" menu.
Other things to try:
Add try/catch blocks around areas that can blow up
Add logging, especially to the try/catch blocks
Put a "sleep" at startup if the program closes before you can attach the debugger.
Also, from #ScottChamberlin, you can directly ask that a debugger be attached from the running executable via System.Diagnostics.Debugger.Launch().

Related

the .exe file made from a C# file won't work properly [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
Improve this question
I want to convert my code to an exe file. The bin folder has an exe file of my code , but when I run this exe file after I enter the data the window closes me without printing me the results.
When I run the C# code in visual studio it ran successfully.
I want my C# code to become an .exe file so people don't know what the code behind the C# file is.
When compiling your Code within Visual Studio, it will automatically generate a fully functional .exe file.
The problem you're having is that the program is done doing his job and closes itself. You have to prevent it from closing itself. You can do that by adding a simple Console.ReadLine(); at the end of your code.
For Example:
using System;
public class Program
{
public static void Main()
{
Console.WriteLine("Hello World");
Console.ReadLine();
}
}
That way the console will wait for any input before it continues to do it's work.

Window application what written in c# by myself not appearing [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
Today I run into a strange error.
When I start my program without Visual studio 2010 Express, start to running, but the gui not appear, and inpossible do stop it in task managger.
But if I run it in Visual studio, it work without any problem.
It do it with my all c# program,even what I write years before, but not any other program.
Tried to check, if a virus do it, but it can't find anything.
Operting system is Windows 7
It can be antivirus who stops execution of your application. Try to turn off it.

Windows 10 IoT Universal App Deployment Fails on Raspberry Pi 2 [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 7 years ago.
Improve this question
I have a Problem with debugging on Raspberry Pi 2.
I have a simple Universal app (for testing purposes only "hello world", it's not the code that causes trouble).
I want to debug this app on my raspberry pi 2.
Yesterday, it all worked perfectly, but now, it's always starting to deploy, and then fails.
The Configuration of the Pi is all okay (Remote, ARM, No authentification..).
I installed the update (I'm using Windows 10) KB3081424, which I already uninstalled again, without any changes.
Also I checked the folders "AppReadiness" and "AUInstallAgent" on C:\Windows, which also exists...
Edit: I get the Error "Build Action 'Embedded Ressource' are not supported by Projects with output-type 'appcontainerexe'.
Based on the error you are receiving "Build Action 'Embedded Ressource'". You may want to ensure that you do not have any items in your Solution Explorer set to a Build Action of Embedded Resource. You can check this in the Solution Explorer as indicated below:

Determining High CPU Usage on my C# Console App [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I am working on a C# console application. It mostly just hosts a soap service, and listens for messages coming in to process. However, even when no soap messages are received, all 6 cores on my laptop are being heavily used. From a code walk through I can't see what is causing it.
Is there are any debug tools in Visual Studio that can help pinpoint where CPU is being eaten up.
You can use the Profiler that is built into Visual Studio.
For Visual Studio 2013, select the menu ANALYZE / Performance and Diagnostics
Use the Performance Wizard.
It will show you hot spots in your code (where the most CPU cycles are being burned).
Note that you may need to launch Visual Studio as Administrator for proper profiling.
NOTE:
You can download stand-alone profiling tools for VS 2010 from Microsoft. See https://stackoverflow.com/a/11197203/141172

Why debugging ASP.net can potentially harm your computer? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
When I try to attach the w3wp.exe process in order to debug asp.net process, a pop-up alerts me that this "can potentially harm your computer".
I just wonder why.
Are you by any chance NOT running visual studio as Administrator? Visual studio needs to be running as Administrator to attach to the ASP.NET worker process without popping up that warning.
EDIT: Looks like this issue is answered in this SO post
IIRC, some older trojans/viruses used debug attachment as a mean to hook into other programs/services.
Nowadays you get a warning. Focus here is not on the words 'harm your computer'. It asks you to check if the process listed is what you'd expect. Imagine that popping asking to debug chrome.exe or skype.exe when you was just idling. That would make me freak out for sure.

Categories

Resources