visual-studio-debugging

What goes in the “Non-Public members” node in Visual Studio's Watch window?

泪湿孤枕 提交于 2019-12-05 22:01:05
I assumed that all Non-Public (ie, private, protected, internal, and internal protected) members of C# objects go under " Non-Public Members " when I look at objects in Visual Studio's Watch Window. But then, I noticed an anamoly with this code: class HashDerived : System.Security.Cryptography.HashAlgorithm { ... } HashAlgorithm hash1 = new HashDerived(); HashAlgorithm hash2 = new System.Security.Cryptography.SHA1Cng(); hash1 's "Non-Public Members" looks like this: whereas hash2 's "Non-Public Members" looks like this: So it seems like for hash1, only the private field (m_bDisposed) appears

Debugging not hit breakpoints in .NET CORE MVC 6 application

亡梦爱人 提交于 2019-12-05 21:56:57
问题 I am working on .NET CORE 1.0 MVC 6 application and I stuck with the debugging point as it stopping hitting yesterday. with number of try I delete project and start again. First time it load symbols even due I have uncheck in Tool --> Debugging --> symbols, however it hit breakpoints. Now it only hitting C# class 'Startup.cs' if I choose 'Enable Just My Code' but in controller. I have Debug option from dropdown, not really sure why. Need help here. I change as Select Debug->Options->Debugging

How can I properly use breakpoints when using an object initializer?

谁说我不能喝 提交于 2019-12-05 18:54:22
For example, doing something like this: foreach (DataRow row in data.Rows) { Person newPerson = new Person() { Id = row.Field<int>("Id"), Name = row.Field<string>("Name"), LastName = row.Field<string>("LastName"), DateOfBirth = row.Field<DateTime>("DateOfBirth") }; people.Add(newPerson); } Setting a breakpoint to an individual assignation is not possible, the breakpoint is set to the entire block. If I want to see specifically where my code is breaking, I have to use: foreach (DataRow row in data.Rows) { Person newPerson = new Person(); newPerson.Id = row.Field<int>("Id"); newPerson.Name = row

DLL Missing from Modules List in VS2010

被刻印的时光 ゝ 提交于 2019-12-05 11:45:45
I've really been banging my head against the proverbial wall over this one. I have a solution which contains both C# and C++ code projects. I often call the C++ DLLs, which are compiled in this project from the C# via P/Invoke. No problemo. All the requisite debugger settings through the *.sln file, as well as the C++ and C# files, have been properly set, to the best of my knowledge. Note: I often am able to debug similarly P/Invoked C++ code with no issues! Naturally, I figured that, perhaps, the symbols weren't loading -- yet, upon opening the modules window, I discovered that the DLL into

OpenCV cvLoadImage() does not load images in visual studio debugger?

自作多情 提交于 2019-12-05 06:00:36
I am trying to work out a simple hello world for OpenCV but am running out of ideas as to why it is not working. When I compile and run this code: #include <cv.h> #include <highgui.h> int main(int argc, char* argv[]) { IplImage* img = cvLoadImage( "myjpeg.jpg" ); cvNamedWindow( "MyJPG", CV_WINDOW_AUTOSIZE ); cvShowImage("MyJPG", img); cvWaitKey(0); cvReleaseImage( &img ); cvDestroyWindow( "MyJPG" ); return 0; } I get a grey box about 200x200 instead of the indicated .jpg file. If I use a different jpg I get the same kind of window, and if I put an invalid filename in, I get a very tiny window

How to trace async database operations in Intellitrace Events?

丶灬走出姿态 提交于 2019-12-05 05:14:11
Im trying to see some queries that my application using EntityFramework does. In my method wich is not async i can see the queries normally: public List<Tool> GetTools() { return EntityContext.ToList(); } But if its like: public Task<List<Tool>> GetTools(int quantity) { return EntityContext.Take(quantity).ToListAsync(); } Is it possible to get the queries of a async method in IntelliTrace Events? Thanks. With EF you can debug to the output window and command line easy enough. Here is a shortcut method I created. public void EnableDebugging() { Database.Log = s => { Console.Write(s);//windows

Console.Writeline working on x86 but not x64

这一生的挚爱 提交于 2019-12-05 04:48:43
I'm testing a project in visual studio 2012. When I run my code in x86, Console.Writeline shows up in the output window. However, when I run it in x64, it does not. I understand I can use System.Diagnostics.Debug instead, but I would really like to understand why Console.Writeline is not working, or if there is a setting somewhere. Thanks. Edit: An observation: The Visual Studio hosting process is disabled for both builds. When I enable it, all Console.Writeline messages show up for both x64 and x86. When I disable it again, only the x86 displays Console.Writeline . There should be no

Visual Studio C# 2010 Express Debug running Faster than Release

我的未来我决定 提交于 2019-12-05 04:23:10
I have a Windows Forms application with exactly 2 threads. These threads have ZERO interaction with each other, Ala the first thread runs without messing with the second thread. There is no Synchronization between them, as there is no need for that to be happening. The first thread deals with the UI of the application, changing colors and labels and has One timer running to catch some user input this timer fires every 200 milliseconds. The second Thread is more involved and runs through its coding constantly until shutdown by the user by exiting the application. The Second Thread first reads

Edit & Continue doesn't work

旧时模样 提交于 2019-12-05 03:56:40
I'm trying to get managed Edit & Continue working (in Visual Studio 2015 v14.0.25425.01 update 3) and it's giving me the dreaded dialog, " Changes are not allowed in the following cases: " Attached to a process that does not support Edit and Continue on attach. I'm using IISExpress v10.0.14358.1000, on Windows 10.0.10586, x64. I have 'Use the 64 bit version of IIS express for web sites and project' checked in Tools->Options. (although, i also get the same error with 32-bit iisexpress) all my code is compiled 'Any CPU' The code being debugged was optimized Nope, the all the code is built with

Why Visual Studio's debug mode Step Into (F11) sometimes doesn't enter inside some functions?

末鹿安然 提交于 2019-12-05 02:50:31
I was debugging a given C++ code with the F11 key (Step Into mode) in order to understand the precise order in which the functions in the code were called and I realized that it would never enter inside some functions unless I set a breakpoint at some line inside the function definition. I mean, if I call a function from the main method, and the function is defined in another .cpp I expect the F11 debugging mode to enter step by step inside the function in order to analize the variable changes. Most of the times it does but in some cases it just execute the function without stepping into it,