I have installed VS 2015 RTM (nothing else) and I'm unable to debug any solution, not matter if it's an existing one or a brand new one (created with VS 2015 and compiled against .Net Framework 4.6), it only opens a new tab in VS which is called Break Mode with the following text:
The application is in break mode
Your app has entered a break state, but no code is executing that is supported by the selected debug engine (for e.g. only native runtime code is executing).
And if I check the Debug --> Module Window:
VS2015Test.vshost.exe no symbols loaded (even if I click load symbol it does not work)
VS2015Test.exe symbols loaded
And it also doesn't show the output on the console(it's a console application that just has the following lines of code:
class Program
{
static void Main(string[] args)
{
Console.WriteLine("TEST");
Console.ReadKey();
}
}
I tried to reinstall VS 2015, restarted the computer, deleted all files in %temp%/AppData/Microsoft/Visual Studio/14, started VS in Admin Mode but nothing seems to work.
One thing which makes debugging working is this option:
Tools --> Options --> Debugging --> Use Managed Compability Mode
^^But that can't be the solution to use an old/legacy mode.
BTW: Debugging in VS 2013 is working fine.
Any help would be appreciated.
In my case this solution is useful:
Solution: Disable the "Just My Code" option in the Debugging/General settings.
Reference: c-sharpcorner
I was having this same problem with VS2015. I reset the settings, as suggested but still had trouble.
What I had to do to fix it was check "Use Managed Compatibility Mode" and "Use Native Compatibility Mode". Not sure which of those 2 is necessary but checking both and I no longer get the Break Mode issue.
I had a very similar issue recently, related to debugging settings.
Firstly have you tried resetting all your settings? I think it may be related to that as you say it is project independent and you've deleted all application data.
Tools-> Import and Export Settings Wizard -> Reset all settings
Don't worry, it gives you the option to save current settings.
Secondly if this fails, I would suggest looking at the event log.
Entering break mode would suggest that the DE (debug engine) is sending a synchronised stop event to visual studio like IDebugExceptionEvent2. I would take a look at the event log for exceptions like failures in loading referenced assemblies (like .NET runtimes, etc) or environment access restrictions.
Something is telling the debugger to stop your running application, its just a case of finding it.
Thought I would post this in case it helps anyone. I installed a clean Win 10 and Visual Studio 2015, tried to debug an existing solution and had problems. Followed some advice listed here and other places but none worked.
How I got the debugging to work as normal was to change the Solution Configuration just below the menus. I had it set previously to Release mode, changed this to Debug and then cleaned/recompiled and hey presto, debugging started working as normal. See the image for info:
My solution suddenly stopped to work in debug.
I received a message during debug.
[Window Title]
Microsoft Visual Studio
[Main Instruction]
You are debugging a Release build of NettoProWin.exe. Using Just My Code with Release builds using compiler optimizations results in a degraded debugging experience (e.g. breakpoints will not be hit).
[Stop Debugging] [Disable Just My Code and Continue] [Continue Debugging] [Continue Debugging (Don't Ask Again)]
I chose to continue to debug, but it still did not work.
The solution was simple. It is necessary in the project properties -> in the build section -> remote the check "Optimiz code"
Check the "Code Type" before attaching to a Process. For example, I had to switch from CoreCLR to v4.*
In my case,
I have changed Platform from x86 to x64 in Debug Configuration Manager. It worked for me.
I disabled avast file system shield and then all worked normal again.
avast-setting wheel= active protections- top button off.
Same is required to publish projects. A real nightmare
I had a problem similar to this when trying to use Debugger.Launch to debug a web application: the JIT Debugger Selection window never appeared. I knew it wasn't a problem with VS debugging mechanism itself because it fired just fine with a console app.
Eventually a colleague mentioned a "global debugger registry setting" which set off a light bulb.
I was using Microsoft's DebugDiag some months ago to troubleshoot IIS crashing, and I had a rule registered to capture IIS crash dumps, which obviously (in retrospect) registered the Debug Diagnostic Service as the debugger for w3wp (IIS worker process).
Removing the rule in DebugDiag, or stopping the Debug Diagnostic Service ("C:\Program Files\DebugDiag\DbgSvc.exe") re-enabled Visual Studio's JIT debugging.
Hope this helps someone.
Uhg. I hit the bottom of this page so I started ripping apart my project. I found a solution for my particular problem.
My Issue: I couldn't hit the break-point inside a threaded process. Nothing fancy, I'm just starting a new thread in a console app and the debugger wasn't stopping on the break points. I noticed the thread was being created but it was getting hung up in .Net Framework external calls and specifically the ThreadStart_Context. That explains why my breakpoints never got hit because the .Net Framework is getting hung up something.
The Problem: I found that I could solve this by changing my startup code. For whatever reason, I had a program.cs file that contained Main() and was inside the Program class as you would expect for a console app. Inside Main(), I was instantiating another class via this code;
new SecondClass();
This normally works fine and I have a bunch of other projects with Threaded calls where it works fine (well, I haven't debugged them for some time so perhaps a service pack came along and is causing this regression).
The Solution: Move Main() into my SecondClass and instead of invoking the SecondClass constructor via 'new SecondClass()', update the SecondClass constructor to be a standard static method and then call it from Main. After making those changes, I am able to debug the thread once again.
Hope this helps.
After installtion of vs 2017,while debugging the solution,there was an error like "Webkit has stopped functioning correctly; Visual Studio will not be able to debug your app any further.",this makes unable to proceed the debugging.To resolve this issue,Go to Tools->Options->Debugging->General then disable the javascript debugging for asp.net
I have had similar issues on my svc application run on visual studio 2015, the solution was to change solution platform from "Any CPU" to "x86", if you cannot see the x86 option then click on "Configuration Manager" and go to your target project and change the platform, you'll need to select the dropdown and click "New", on the pop up, click the drop down list under "new platform" and select x86, save your changes and rebuild(See attached)
Stop debugging.
Edit csproj.user file
Find section wrote below:
<SilverlightDebugging>True</SilverlightDebugging>
Change Value to "False"
Unload and reload your project in Visual Studio.
Sometimes it needed to close Visual Studio.
A friend had the same problem, he couln't debug in VS2015 but it was ok in VS2013. (our project is in .Net v4.0)
We have found that it was the "Code Type" option in Debug / Attach to Process that was set to "Managed (v3.5, v3.0, v2.0)" instead of "Managed (v4.5, v4.0)"
I had this issue, and none of the (myriad of) posts on here helped. Most people point towards settings, or options, turning on Debug mode, etc. All of this I had in place already (I knew it wasn't that as this was working fine yesterday).
For me it turned out to be a referencing issue, a combination of DLLs that were included were to blame. I can't say exactly what the issue was, but I have a couple of classes that extended base classes from another project, an implemented interface that itself extends from another interface, etc.
The acid test was to create a new class (in my case, a Unit Test) within the same project as the one failing to Debug, then create an empty method and set a breakpoint on it. This worked, which further validated the fact my settings/options/etc were good. I then copied in the body of the method that failed to Debug, and sure enough the new method starts failing too.
In the end I removed all references, and commented out all the lines in my method. Adding them back in one by one, checking Debug at each step, until I found the culprit. I obviously had a rogue reference in there somewhere...
We had this issue, after trying all other options such as deleting .vs folder, Renaming IISExpress folder name, Updating various setting on properties etc it did not work. What worked though, was uninstalling IISExpress 10.0, and Reinstalling it along with turning all IIS related features on from Windows Features. Hope this helps someone.
I changed my Platform Target from "Any CPU" to "x64".
Setting available at : Project Properties -> Build -> General: "Platform Target"
I use VS 2015.
I found I had to go to the project settings -> web, and tick the Enable Edit and Continue checkbox. I cannot say why it was unchecked to begin with, but this solved it for me.
from Solution Explorer -> Web -> Properties
select Build tab -> Configuration combobox:
Just change your Configuration from "Release" to "Active (Debug)"
In my case it was due to the project Target platforms were different.
Consider : ProjectA (Entry) --> ProjectB
ProjectA's platform in properties was set to x64.
And ProjectB's platform was 'AnyCPU'.
So after setting ProjectB's target platform to x64 this issue got fixed.
Note: It's just that Target Platform has to be in sync be it x64 or
'Any CPU'
In my case, I found a hint in the output window that the exception that stopped the debugger was a ContextSwitchDeadlock Exception, which is checked by default in the Exception Settings. This Exception typically occurs after 60 seconds in Console applications. I just unchecked the exception and everything worked fine.
I had this same issue. In my case, the dll I was trying to debug was installed in the GAC. If your debugging breakpoint hits when you aren't referencing any object in the target assembly, but doesn't when you reference the assembly, this may be the case for you.
I had this problem after deinstallation of RemObjects Elements 8.3 Trial version. Reinstall Elements 8.3 is a quick bugfix.
I got in this issue as well. I'm using VS 2015 (Update 3) on Windows 10 and I was trying to debug a Windows Forms Application. None of the suggestion worked for me. In my case I had to disable IntelliTrace:
Tools > Options > IntelliTrace
I dont know the reason why, but it worked. I found out the root of the problem when I opened the Resource Monitor (from Windows Task Manager) and I realized that IntelliTrace process was reading a tons of data. I suspect this was causing locks in vshost process, because this one was consuming 100% of a cpu core.
I hade the same problem. After trying the other solutions here without luck, I had to repair the installation through the installer.
Control Panel > Programs > Programs and Features
Then scroll down to Microsoft Visual Studio, right click it, then "Change". Then at the bottom of the window, click Repair. The repair process will take a decent amount of time, and at the end you will have to restart your computer.
This fixed the problem to me, and I hopes it will help you.
I've got a huge problem. I was writting an WFA + C++/CLI DLL application. Everything worked fine until I had to sent it to my friend. Every time he executed the exe file from bin/debug (+additional dll and xml files) nothing happened (he doesn't have Visual Studio installed). The problem doesn't occur to me. On my PC everything works fine.
What i noticed (after couple of hours looking up the solution) is that somehow this is the critical moment :
log = new StreamWriter("log.txt", true);
log.WriteLine("3c");
log.Close();
materialTypeComboBox.SelectedIndex = 0;
log = new StreamWriter("log.txt", true);
log.WriteLine("3d");
log.Close();
"3c" is the last line in my simple log file every time my friend execute this. If I comment this, app crashes on
foreach (RadioButton item in someGroupBox.Controls.OfType<RadioButton>()) { ... }
Seems like WFA's Controls cause that effect, but how is it possible?
I tried changing target framework form 3.5 to 4.5.1, building project in Debug and Relase mode, x86, x64, using a installShield projects (I thought I missed some references while sending him the app), one-click installer, creating empty project and paste sources - without any success.
How could it be? No exception, no message box, nothing. Just click and nothing happens.
Does anybody know some solution?
Windows Forms is renown for it's ability to silently swallow exceptions. I would highly recommend logging unhandled exceptions. To log unhandled exceptions, do the following:
Application.ThreadException += new ThreadExceptionEventHandler(UnhandledUIException);
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandledException);
private static void UnhandledUIException(object sender, ThreadExceptionEventArgs e)
{
// Log exception
}
private static void UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
// Log exception
}
Info: http://msdn.microsoft.com/en-us/library/system.appdomain.unhandledexception.aspx
Info: http://msdn.microsoft.com/en-us/library/system.windows.forms.application.threadexception.aspx
SOLVED:
The problem was with the DLL - with Dependency Walker I discovered that my DLL needs msvcr120.dll to run, and even including it to project output folder did not help, and also msvcr causes the x84/x64 mismatch error. Recompiling DLL solved problem:
Statically Linking the DLLs
Make sure you resolve it for both Release and Debug. The steps are slightly different.
Release
In Visual Studio, I went to the project Properties. I changed
my Configuration to Release. I went under Configuration Properties |
C/C++ | Code Generation Look at the Runtime Library setting. It is
set to this: Multi-threaded DLL (/MD) Change it to this:
Multi-threaded (/MT) Rebuild. Debug Almost exactly the same as
release.
Debug
In Visual Studio, I went to the project Properties. I changed my
Configuration to Debug. I went under Configuration Properties | C/C++
| Code Generation Look at the Runtime Library setting. It is set to
this: Multi-threaded Debug DLL (/MDd) Change it to this:
Multi-threaded Debug (/MTd) Rebuild the debug
http://www.rhyous.com/2010/09/16/avoiding-the-msvcr100-dll-or-msvcr100d-dll/
I am using Visual Studio 2010 Professional Edition, and Windows Vista.
Firstly, I have this code. As you can see, it will crash the program!
using System;
namespace Crash
{
class Program
{
static void Main(string[] args)
{
string a = null;
if (a.Length == 12)
{
// ^^ Crash
}
}
}
}
The program will crash on the if statement. Now, I want to find out that it crashed on that if statement.
If I "Start without Debugging" from Visual Studio, Crash.exe crashes. It uses 1,356kb of memory. I get the Vista option of Close Program/Debug. If I choose Debug, I can open a new instance of Visual Studio, and it points me to a NullReferenceException on the if statement. This is good.
Now let me assume that it crashes on another computer, and I get them to give me a Dump File via Task Manager. It is 54,567kb. Why so big! It's vast! Anyway, I am less interested in that (slightly)
If I open that dump with Windbg, I get very little of use to my untrained eye:
Microsoft (R) Windows Debugger Version 6.12.0002.633 X86
Copyright (c) Microsoft Corporation. All rights reserved.
Loading Dump File [C:\Users\Richard\Desktop\Crash.DMP]
User Mini Dump File with Full Memory: Only application data is available
Symbol search path is: SRV*C:\SYMBOLS*http://msdl.microsoft.com/download/symbols
Executable search path is:
Windows Server 2008/Windows Vista Version 6002 (Service Pack 2) MP (4 procs) Free x86 compatible
Product: WinNt, suite: SingleUserTS Personal
Machine Name:
Debug session time: Sat Jan 15 11:07:36.000 2011 (UTC + 0:00)
System Uptime: 0 days 4:24:57.783
Process Uptime: 0 days 0:00:05.000
........................
eax=002afd40 ebx=77afa6b4 ecx=002afd48 edx=00000001 esi=001cdaa4 edi=00000000
eip=77bf5e74 esp=001cda5c ebp=001cdacc iopl=0 nv up ei ng nz ac pe cy
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000297
ntdll!KiFastSystemCallRet:
77bf5e74 c3 ret
However, this is of less interest to me. As far as I can tell, I need to write commands in to get useful output, and Visual Studio is better.
So I open it with Visual Studio. I can choose to "Debug with Native Only", but I get lots of things that mean something to clever people like you, and I am not clever! I get these two screens:
So, my question:
How do I show Visual Studio to my source code?
Also, is there a way to get a smaller dump file? It seems ridiculously big, even after compressing. I don't understand why there couldn't be one which is only just a tiny bit bigger than the program's footprint, and still get a nice debugging, with the source code.
The much advertised feature that Visual Studio 2010 allows you to debug crash dump files and step through the managed source code comes with a gotcha: it works only for .NET 4.0 assemblies. Here are the steps:
Create a crash dump file on another computer using the Task Manager
Open the solution in VS2010
Open the .DMP file (File->Open...)
Click on Debug With Mixed (This will be visible only for .NET 4.0)
Source code will open and you will be able to inspect the exact cause and location of the exception
As far as debugging with native only is concerned Visual Studio is no more useful than WinDbg.
The tooling you are using here wasn't ever designed to troubleshoot crashing managed programs. Minidumps and Windbg is what you use to find out what's wrong with code written in C or C++. Pretty important tools, these are languages whose runtimes have no support for the kind of goodies you can get out of a crashing managed program. Like an exception with a stack trace.
The reason the minidump sizes are so different is because of the mini in minidump. By design, it was meant to capture a small snapshot of the process. The relevant argument is DumpType in the MiniDumpWriteDump function. There's really clever code in this function that can figure out what parts of the process state don't need to be recorded because you are not likely to use it in the debugger session. Which you can override by providing additional dump type flags. The minidump that Explorer generates has all of those flags turned on, you get the whole kit and caboodle.
Which is actually pretty important for a managed program. The heuristics used by this minidump creator is one that's only appropriate for unmanaged code. Debugging a managed program dump only works well when you include the entire garbage collected heap in the dump. Yes, that will be a large dump, mini doesn't apply anymore.
Your next problem is that you are getting the soul of the machine view from the minidump data. Your screen shots are showing the machine code. You happen to be located inside of Windows in those shots, note how ntdll.dll is on top of the stack. The mscorwks.dll entries are the CLR. Further down, out of view, you ought to see stack frames from your own code. You'll however see the machine code that was generated by the JIT compiler. Not your C# code.
There's a Windbg add-in called sos.dll that extends the command set of Windbg to be able to inspect managed data. Just google "sos.dll" to get good hits. This is however still a looong way away from the kind of debug experience you'll get out of the Visual Studio debugger. Which is intimately aware of managed code, very unlike Windbg or the VS debugger that can load minidumps. Sos was really designed to troubleshoot CLR bugs.
There were no dramatic improvements in VS2010 other than the minidump info page you now see. Which really doesn't do much at all. I suspect the Debugger Team to have this on their todo list, there are surely some fundamental problems to overcome. Particularly in the minidump format and creation code. Use connect.microsoft.com to provide feedback, they pay attention to it and let votes affect their priority list.
You should be supplying the related pdb (program database) file to the debugger so it can load the symbols. Also to get a better view, use Microsoft Public Symbol server. This article contains information on it.
I have a strange error. I'm debugging an asp.net site and suddenly it stops. Visual Studio stays in debug mode and my web application stays on running just fine. I found this post on, but I don't think a background thread is causing the problem. There's even a try catch around the code where it usually stops debugging, but the catch is not triggered... Everytime I try it, it stops at a different place in the code.
Have you set your debugger to break on all exceptions, not just unhandled exceptions?
Debug -> Exceptions -> Check the "Thrown" box for everything (or at least just Common Language Runtime Exceptions). If an exception is thrown during debugging, on any thread, this should cause the debugger to highlight and break on the "thrower".
Another thing to try, is to reset all your IDE settings. I've had various odd behaviours before where settings got corrupted and the IDE stopped behaving sensibly: Tools -> Import and Export Settings -> Reset All Settings.
In addition to Daniel Dyson's answer - if you "pause" as he suggests (once the debugging has "stopped"), open the "Threads" debug window. Are there any threads showing that have an entry in the "location column". If so, this is probably your code executing. Click on each in turn. Can you account for what each thread is doing, or does this shed any light on this odd behaviour?
Have you tried hitting the Pause || button? This will pause the debugger wherever it is executing, so if you are in an infinite loop outside of your try catch block, you will be able to find out where.
Add a breakpoint in Application_Error Event in the Global.asax.
Check mode in your ide its set to Debug not to Release.
Because cannot able to debug your application if it set to Release mode.
check for detail : http://msdn.microsoft.com/en-us/library/e8z01xdh(VS.80).aspx
Make sure the "Ping Enabled" setting is set to "False" in the IIS configuration.
In IIS7, right-click on your AppPool, choose "Advanced Settings," navigate down to the Ping Enabled setting and change it to false.
If you're using IIS6, the setting is slightly different. I believe it's called "Ping Interval" if I remember correctly and it's set to a number of seconds.
I solved the same problem. I post the solution here, hope it'll help someone in the future.
Here is my condition:
I use Visual Studio 2015 to debug my game on Unity (visual studio tools for unity)
After a few minutes of debugging, the debugging arrow disappear.
What cause it:
I had enabled "Show Threads in Source Code".
Solution:
Disable "Show Threads in Source Code", then restart Visual Studio (and Unity if you're using Unity).
Run debugging to make the button "Show Threads in Source Code" appear.
Disable "Show Threads in Source Code".
Close Visual Studio (and Unity).
Open Visual Studio (and Unity)
I've just recently upgraded to using Visual Studio express editions with service pack 1. Previously I was using the express editions minus the service pack. The IDE for C++ and C# run fine for me but when running the Visual Web Developer IDE I get a crash when trying to switch to design mode on any page I attempt it on.
I have been able to track down the particular line and module this crash is occurring in. Its from the file afxcrit.cpp from the DLL fpacutl.dll. The relevant function where the crash is occurring is as follows...
void AFXAPI AfxLockGlobals(int nLockType)
{
ENSURE((UINT)nLockType < CRIT_MAX);
// intialize global state, if necessary
if (!_afxCriticalInit)
{
AfxCriticalInit();
ASSERT(_afxCriticalInit);
}
// initialize specific resource if necessary
if (!_afxLockInit[nLockType])
{
EnterCriticalSection(&_afxLockInitLock);
if (!_afxLockInit[nLockType])
{
InitializeCriticalSection(&_afxResourceLock[nLockType]);
VERIFY(++_afxLockInit[nLockType]);
}
LeaveCriticalSection(&_afxLockInitLock);
}
// lock specific resource
EnterCriticalSection(&_afxResourceLock[nLockType]); // <--- CRASH HERE !!!
#ifdef _DEBUG
ASSERT(++_afxResourceLocked[nLockType] > 0);
#endif
}
Any help/thoughts is greatly appreciated.
Well the computer has lost in the end as it always does! I found this thread to be a big help as there were a bunch of people posting with very similar issues to mine...
http://forums.asp.net/t/1186584.aspx?PageIndex=1
On the first page there is the following suggestion...
Make sure Microsoft Web Authoring
Component appears in Control Panel. If
it does, uninstall it. The go to
WCU\WebToolsCore\en-us in VS DVD and
run WebToolsCore.exe. The setup does
not have UI, give it about 10 minutes
to finish. Verify that Web Authoring
Component appears in Control Panel.
Try go to DV again.
I followed through with this suggestion and uninstalled the "Microsoft Web Authoring Component" however I couldn't find the "WebToolsCore" folder in the express installation disc as noted in the details. I did however find the folder "X:\VWDExpress\WCU\WebDesignerCore". Figuring this is pretty much the same thing I installed WebDesignerCore.EXE and WebDesignerCore_KB945140.EXE which are both in the the WebDesignerCore folder. Its a silent install so nothing looks immediately to have taken effect but when I headed into Visual Web Developer and switched to design mode success! It works!
Is your installation customised in anyway? Do you have VS add-ins, etc. installed? If so, try removing them one by one and/or restore all app settings back to their defaults. I'm not so familiar with the express editions so I'm not sure what kind of customisations they support.
If all else fails, I hate to say it but...
1) make sure all your work is safely saved seperately from the application folders and/or is backed up
2) uninstall the app (if uninstall options are given, use the most complete one, e.g. delete all files, settings, preferences, etc.)
3) reboot
4) run CCleaner (both file deletion and registry fixer)
5) reboot
6) re-install
That is my tried and tested fall back method for when simply 'all else fails'. It usually works unless there is a genuine bug in the software.
You don't actually have to remove the Microsoft Web Authoring Component. A simple repair from the add/remove programs dialog works just fine.