visual-studio-debugging

Is there a way to prevent Visual Studio from breaking on exceptions in a specific method?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 05:55:08
I know I can control the way Visual Studio handles exceptions according to their type and to the fact that they're eventually caught using the "Exception" dialog. However, I've got a library that's internally throwing (and catching) an ArgumentOutOfRange exception when I'm calling a specific method. The exception is thrown (and caught by the library) maybe 1% of the time, but I'm calling this method a lot. The editor says it's by design (and indeed, the design they've chosen makes sense). The thing is that I don't want Visual Studio to break each time the exception is thrown. I don't want to

Vector 'no operator “[]” matches these operands' error in Visual Studio watch

筅森魡賤 提交于 2019-12-03 05:42:38
When stepping through the following sample code in Visual Studio 2012: std::vector<int> test; test.resize(1); test[0] = 4; I can set a watch on test and inspect its 0th element. However, if I set a watch on test[0], I get the error 'no operator "[]" matches these operands': How can I inspect the value of test[0] directly? I found one solution which does not depend on the internals of the class. The expanded form of the operator call seems to work for me. In this case it's the following code: v.operator[](0) I tested it in Visual C++ 2012. As @NateKohl noted, in Visual Studio 2012 (and possibly

Visual Studio 2012 crashes every time I try to debug with error CLR20r3

人走茶凉 提交于 2019-12-03 05:14:35
Every time I try to debug one of my apps I get the below error message. Anyone have any ideas? I tried running Visual Studio in safe mode but I get the same thing. I also tried to repair the install and completely reinstall it with no luck :(. The full Problem Signature is this: Problem signature: Problem Event Name: CLR20r3 Problem Signature 01: devenv.exe Problem Signature 02: 11.0.50727.1 Problem Signature 03: 5011ecaa Problem Signature 04: Microsoft.IntelliTrace.Package.11.0.0 Problem Signature 05: 11.0.50727.1 Problem Signature 06: 5011dad8 Problem Signature 07: 311 Problem Signature 08:

Enable breakpoint B if breakpoint A has been hit

风流意气都作罢 提交于 2019-12-03 04:16:40
问题 I'm often find myself setting a breakpoint A somewhere in the code and manually enabling one or more breakpoints when this breakpoint is hit. A typical case is when I'm debugging an unittest and don't care about the preceding tests. void testAddZeros() { Number a(0); Number b(0); Number result = a.add(b); assert((a + b) == Number(0)) } void testAddOnes() { Number a(1); Number b(1); Number result = a.add(b); assert((a + b) == Number(2)); } void testAddNegativeNumber() { Number a(1); Number b(

How to configure ASP.NET Core 1.0 to use Local IIS instead of IIS Express?

余生颓废 提交于 2019-12-03 03:03:16
问题 How can I setup a .Net Core 1.0 project to use Local IIS instead of IIS Express when debugging? I have tried modifying launchSettings.json file in various ways. For example, replacing all occurrences of IIS Express with Local IIS and updating the applicationUrl and launchUrl to use my custom localhost http://sample.local (I have updated the host file and configured IIS manager already) but not happy. Default settings of Properties/launchSettings.json file: { "iisSettings": {

Visual Studio: Debugging a referenced DLL, I have source in another SLN

我们两清 提交于 2019-12-03 01:34:19
问题 I am trying to debug a project that has a reference to a DLL that I added, the DLL is stored in an external directory and I just added a reference. Now of course I can debug my project but the line that calls a method on my other dll I can't step into it, i.e. F12. One way I was able to do this was to add my project (dll) as an existing project to my solution and replace the referenced dll to use the attached project rather than a file on disk. But what a mess, I am sure there is a cleaner

Visual Studio 2015 Debug doesn't work in multithread application

假装没事ソ 提交于 2019-12-02 22:16:34
In my project I have a heavy part of code that should be executed on a separate thread without blocking UI. When debugger hits the breakpoint inside this code, VS2015 freezes for 5-10 seconds. After that, if I try to continue debug (by pressing Step Over, Step In or Continue), the app goes from paused state to working state, Debugging Tools are ticking, but nothing happens and there's 0% of CPU utilization. If I press Break All then, the "cursor" (don't know the correct term) is shown at Application.Run( new Form1() ); in Program.cs where Main() is. As I'm pretty new to C#, I thought that

Is it possible to watch the value of a memory location using the Visual Studio Debugger's Watch window?

心已入冬 提交于 2019-12-02 21:18:43
Yes, I know there are four Memory windows, but I much prefer the display of a single value in the watch window, and I'm wondering if it's possible to specify a memory location to watch in the watch window. Putting the address by itself just evaluates to the address in hex. If you want to watch a particular memory location then you need to tell the debugger the type of the object that lives in that location. Instead of just 0x00aabbcc use (SomeType*)0x00aabbcc . Once the debugger knows the type of the memory location it will treat it just like a typed local and display values accordingly

Can't break in global.asax / Application_Start

独自空忆成欢 提交于 2019-12-02 21:17:02
I got a break point on the first line of Application_Start() , but Visual Studio wont break on it. Visual Studio have attached itself to the IIS working process: Auto-attach to process '[2092] w3wp.exe' on machine 'SRD00510' succeeded. My breakpoint in the home controller do work. update I've tried: iisreset restarted visual studio Rebooted. Tried to reinstall aspnet ( aspnet_regiis -i ) Reading your question, I assume you are using IIS for debugging, not Visual Studio Development Server. In this case, debugging application start is tricky, because it is only called once when the application

Setting a value in the debugger of a shared section

爷,独闯天下 提交于 2019-12-02 20:29:45
问题 I have the following code in a DLL: #pragma data_seg("ABC") __declspec (dllexport) char abc[2000] = { 0 }; #pragma data_seg() #pragma comment(linker, "-section:ABC,rws") I have the following code in an executable: extern "C" __declspec(dllimport) char abc[]; char *abcPtr = abc; #define iVar0 (*(long *)(abcPtr)) int main() { printf("Value: %d %p\n", iVar0, &iVar0); iVar0 = 66; printf("Value: %d %p\n", iVar0, &iVar0); char buffer[256]; scanf_s("%s", buffer, 256); } When I run the first instance