visual-studio-debugging

How to package and deploy a NuGet package with symbols and source code so that debugger can use THAT source code?

こ雲淡風輕ζ 提交于 2019-12-08 02:35:52
问题 I have created a very simple NuGet package from a .net framework visual studio Class Library project, where the class library source is in C#. I used this command to create the nuget package: nuget pack MyProject.csproj -symbols -Properties "Configuration=Debug" -suffix debug Which creates, as I expect, two nuget package file, namely: MyProject.1.0.0-debug.symbols.nupkg MyProject.1.0.0-debug.nupkg These packages are basically identical other than that the one with "symbols" includes the pdb

Debug .NET Core source (Visual Studio 2019)

早过忘川 提交于 2019-12-08 02:34:17
问题 I use Visual Studio 2019 and .NET Core 3 web application. I'd like to debug .NET Core source code, so when an error occurs I can dive into the code and examine it in more detail. As I couldn't find an exact description on how to do it (even on Microsoft documentation site), I'll try to summarize here what I know so far. I have the following options in Visual Studio: Enable just my code Enable .NET framework source stepping Enable source server support Enable source link support The first two

Use of #if defined(_DEBUG)

末鹿安然 提交于 2019-12-08 02:32:20
问题 I am writing a C++ MFC-based application. Occasionally I will add #if defined(_DEBUG) statements in order to help me during the development process. My manager has demanded that I remove all such statements as he doesn't want two versions of the code. My feeling is that without the ability to use #if defined(_DEBUG), bugs are more likely to creep in undetected during the development process. Does anyone else have any thoughts on this? 回答1: Well, the runtime library, and the MFC has two

How to pass multiple commands arguments in visual studio?

元气小坏坏 提交于 2019-12-07 23:17:05
问题 I am working on a compession/decompression project using the LZMA SDK. The main program contains some arguments that I must use to run the application To run it from the command line, I use : ./LzmaUtil.exe e input.elf output.elf I'm using VS 2013 , so i have added e in.elf out.elf to the commands arguments, I rebuild the project (the executable file in generated) but nothing seems to happen when I press RUN. Note that I have the input.elf in the debug folder were the .exe is present there,

How to prevent the debugger from calling some source code when paused?

天涯浪子 提交于 2019-12-07 12:58:52
问题 In visual studio, when an application is stopped during debug mode you can hover over an object/property to see whats inside of it. When you open up an object using the debugger like I did with the above picture, the property has it's Get method called as a way for the debugger to retrieve the value of the property to show the user. class Program { static void Main(string[] args) { Foo foo = new Foo(); foo.MyLock.EnterWriteLock(); foo.Bar = 5.1; foo.MyLock.ExitWriteLock(); // "I stop here and

How to get the current line number at break/exception in Visual Studio add-in?

不问归期 提交于 2019-12-07 11:12:25
问题 I'm messing around with the Visual Studio add-in API trying to see if something I want to do is possible. One thing I am doing right now is something like: public void Exec(string commandName, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled) { _applicationObject.Events.DebuggerEvents.OnExceptionThrown += DebuggerEvents_OnExceptionThrown; handled = false; if(executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault) { if(commandName == "MyAddin1

Debug Assertion Failed OpenCv is_block_type_valid(header->_block_use)

懵懂的女人 提交于 2019-12-07 07:01:24
问题 I am new to Programming using Visual Studio and openCv. I wrote a simple program to display the red channel of an image, but every time i run the code it throws "DEBUG ASSERTION FAILED" error. #include <opencv2\imgproc\imgproc.hpp> #include <opencv2\highgui\highgui.hpp> #include <iostream> using namespace std; using namespace cv; int main() { Mat image; image = imread("C:/Users/siddartha/Pictures/sample.jpg"); if (!image.data) { cout << "Cannot load image"; return -1; } else { if (image

How to combine DebuggerHidden with iterator block methods?

假装没事ソ 提交于 2019-12-07 05:12:19
问题 DebuggerHidden is pretty handy for marking helper methods, making sure unhandled exceptions stop the debugger in a convenient place: Unfortunately this doesn't seem to work with iterator blocks: (if it did, the debugger would show the in as the current statement in the second example). While this is obviously a limitation of Visual Studio (for which I've submitted a report), is there some way I could perhaps work around this issue while still using an iterator block? I am guessing that this

DLL Missing from Modules List in VS2010

末鹿安然 提交于 2019-12-07 04:46:56
问题 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

Tracking duration of functions calls in vb.net

随声附和 提交于 2019-12-07 04:41:17
问题 In our VB6 applications, we added a few utility functions for tracking the amount of time spent in a function. We did this to track performance bottlenecks. Basically, how it worked was there were two utility functions: StartTickCount() and EndTickCount(). You would pass the name of the function in each, and the functions would use a dictionary to get the tick count when StartTickCount() was called, and then subtract the tick count when EndTickCount() was called. This wasn't perfect because