visual-studio-debugging

Visual Studio 2013 can't debug javascript in cshtml

不问归期 提交于 2019-11-28 20:05:51
I have an ASP.NET Web Application created with Visual Studio 2013. I am attempting to debug JavaScript in a CSHTML file. However, whenever I launch the webpage, any breakpoint turns into a red circle arrow and states, "The breakpoint will not currently be hit. No executable code of the debugger's target code type is associated with this line. Possible causes include: conditional compiliation, compilier optimizations, or the target architecture of this line is not supported by the current debugger code type." Recently, the project was switched over to support MVC and RAZR, neither of which I

'Step Into' is suddenly not working in Visual Studio

丶灬走出姿态 提交于 2019-11-28 18:28:11
问题 All of a sudden, I have run into an issue where I cannot step into any code through debugging in Visual Studio. The step over works fine, but it refuses to step into ( F11 ) any of my code. This was working before, now all of a sudden it does not. I've tried some things below, but I still had no success: Delete all bin files in every project in my solution, clean solution, re-build solution. Build projects in solution indivdualy Restart machine It an ASP.NET C# application consuming a WCF

How to debug class library that called from external app?

社会主义新天地 提交于 2019-11-28 18:18:48
There is an external workflow that executes C# scripts and is able to work with DLL files(my class library). Is it possible to attach debug to my class library project so breakpoint will hit once this WF will call it? Thanks Yes, you can do this with Visual Studio. You have two options: Configure your project to start the external program Open your DLL project. On the properties for the project, go to the Debug tab. Choose Start external program and give the path of the external program that will call your DLL, along with any command-line arguments you may need to supply, and the working

VS2012 Breakpoints are not getting hit

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 18:10:39
I have a class that looks like this: public class MyService { private MyService(){} public static string GetStuff() { var stuffDid = new MyService(); return stuffDid.DoStuff(); } private string DoStuff() { //do stuff } //other private helpers } Obviously I left a lot out, but thats the general shell. Now, I have a unit test: [Test] public void MyTest() { var results = MyService.GetStuff(); } I set breakpoints on my unit test, and I can see that results has data. However, I set breakpoints literally all over MyService and nothing gets hit unless I put them on a curly brace. Which I can't

Debugging exceptions in a Async/Await (Call Stack)

浪子不回头ぞ 提交于 2019-11-28 17:09:42
问题 I use the Async/Await to free my UI-Thread and accomplish multithreading. Now I have a problem when I hit a exception. The Call Stack of my Async parts allways starts with ThreadPoolWorkQue.Dipatch() , which doesn't help me very much. I found a MSDN-Article Andrew Stasyuk. Async Causality Chain Tracking about it but as I understand it, its not a ready to use solution. What is the best/easiest way to debug if you use multithreading with Async/Await? 回答1: The article you found does a good job

How do I start a program with arguments when debugging?

只愿长相守 提交于 2019-11-28 17:08:06
I want to debug a program in Visual Studio 2008. The problem is that it exits if it doesn't get arguments. This is from the main method: if (args == null || args.Length != 2 || args[0].ToUpper().Trim() != "RM") { Console.WriteLine("RM must be executed by the RSM."); Console.WriteLine("Press any key to exit program..."); Console.Read(); Environment.Exit(-1); } I don't want to comment it out and and then back in when compiling. How can I start the program with arguments when debugging? It is set as the StartUp Project. Go to Project-><Projectname> Properties . Then click on the Debug tab, and

Debugger not breaking/stopping for exceptions in async method

天涯浪子 提交于 2019-11-28 16:57:36
When a debugger is attached to a .NET process, it (usually) stops when an unhandled exception is thrown. However, this doesn't seem to work when you're in an async method. The scenarios I've tried before are listed in the following code: class Program { static void Main() { // Debugger stopps correctly Task.Run(() => SyncOp()); // Debugger doesn't stop Task.Run(async () => SyncOp()); // Debugger doesn't stop Task.Run((Func<Task>)AsyncTaskOp); // Debugger stops on "Wait()" with "AggregateException" Task.Run(() => AsyncTaskOp().Wait()); // Throws "Exceptions was unhandled by user code" on "await

What does Visual Studio consider “User Code”?

时光总嘲笑我的痴心妄想 提交于 2019-11-28 13:20:57
Suppose I have a function that throws an exception. Suppose this function is called by a third-party DLL, and the third-party DLL will handle the exception I’ve thrown. If Visual Studio decides that the third-party DLL is not "user code" (as seen in the image below) then it will stop on my exception by default, even though it gets handled later. It isn’t exactly wrong to do so; it clearly explains that the exception was unhandled by user code . But what is it that makes Visual Studio call some DLLs "user code" and others not? I had a theory that this happens because the symbols aren’t loaded,

Disable/remove child Breakpoints?

谁都会走 提交于 2019-11-28 12:06:26
I'm debugging an ASP.NET Website with C# in Visual Studio. When I set a breakpoint (during debug), over time, the created breakpoint will accumulate many child breakpoints. (See here .) Now, sometimes when I remove a breakpoint by clicking the red glyph, the breakpoint will still be hit the next time the line is executed, because the child breakpoints persisted. Removing the breakpoint in the breakpoint window will resolve the problem, but it's annoying to find the correct breakpoint(s) when you have many set. Also, the removal of a breakpoint with many children is quite a slow operation. So

Automatically Kill IIS Express Process After Debugging (VS Express 2013 Web)

杀马特。学长 韩版系。学妹 提交于 2019-11-28 11:13:34
I'm developing an ASP.NET (Razor v2) Web Site in Visual Studio 2013 Express for Web, so when I run the site to debug, VS automatically starts up an IIS Express process. When I stop debugging using the VS "Stop Debugging" button, the IIS Express System Tray and IIS Express Worker Process continue running, even after VS detaches. (And, I suspect, carrying a bad state from one run to the next, but that's a different question entirely.) Is there a VS option or project setting somewhere that I can set to automatically kill this process once I hit the "Stop Debugging" control in VS? Yes, add the