I'm getting an error when I try to inspect variables in my VS 2017 C# code. The errors started with an upgrade.
Native View To inspect the native object, enable native code debugging.
The a google search suggests the following fix, but I cannot find this option on y Project-Properties-Debug page.
To enable debugging of unmanaged code
With a project selected in Solution Explorer, on the Project menu, click Properties.
Click the Debug tab.
Select the Enable unmanaged code debugging check box.
Try This
add the following to your profile in launchsettings.json
"nativeDebugging" : true
I have also read some posts it says like
starting in Visual Studio 2017 version 15.5 you should be able to set <EnableUnmanagedDebugging>true</EnableUnmanagedDebugging> in your .csproj file.
Related
I don't know what happens with my Visual Studio 2022. When I create a C++ console project, I can build the project. However, when I do the same thing for C# project, I can not build the project. I look like in the picture. Any help is truly appreciated.
I tried everything I can but it didn't work.
That sounds like a bug. When a new project is created, it should appear in Solution Explorer. However your solution has no projects, and the source file appears in "Miscellaneous Files" (meaning it's not part of a project, and therefore VS won't know how to build it).
Please use the Visual Studio Installer to run a repair on your VS installation. If that doesn't help, use Help | Send feedback | Report a problem and include a recording of the steps you're taking to create a new project. If you link the feedback ticket here, I can make sure it gets looked at by the right people. Thanks.
You need to create a new Console App for creating and running C#
projects
Press F5, choose Debug > Start with debugging from the Visual Studio
menu, or select the green Start arrow and project name on the Visual
Studio toolbar. Or, to run without debugging, press Ctrl+F5 or choose
Debug > Start without debugging from the Visual Studio menu.
I have a C# app that I haven't worked on for a while. The last time I worked on this was with Visual Studio 2019. It still opens and runs in debug mode with VS 2019. IF OI open it with VS2022 it will not run in debug mode. I get and error:
Cannot change thread mode after it is set.
What causes this and what might the solution be?
Please follow the steps below:
Go to project properties by right-clicking your project name in the project explorer and choosing properties
In the project properties window, select Build on the left side of the list
On the right side make sure you uncheck "Prefer 32-bit"
Save the project
Debug and test your project. This should resolve the issue.
Screenshot of Project Properties
I am using Visual Studio Community 2019 Preview (16.11.0 Preview 1.0).
I'd like to calculate code metrics for a native C/C++ project but am having trouble. When starting Visual Studio the first time, I had the menu entry "Analyze > Calculate Code Metrics". When selected this created the tab "Code Metric Results" but it was empty. If I try to run again, the menu option was no longer available.
If I try the suggestion in the issue reported at the following link, the menu option reappears:
https://developercommunity.visualstudio.com/t/cant-find-analyze-code-metrics-menu/1033841
However, when I select the option I get a popup with the following error message:
Cannot calculate code metrics because none of the selected projects support code metrics or Visual Studio is debugging an application.
I'm not debugging so my guess is that metrics are not supported in C/C++. Can someone confirm? If so, The documentation should state that and the option and tab should not be shown.
I use. VS 2013 Express
When debugging, I need to stop automatically on exceptions.
try to follow this.
http://msdn.microsoft.com/en-us/library/d14azbfh.aspx#AddExceptionsCommand
It says I need to add Exceptions command to the Debug menu
On the Tools menu, click Customize.
The Customize dialog box appears.
Click the Commands tab and, in the Menu bar list, click Debug.
Click Add Command.
In Categories in the Add Command dialog box, click Debug.
In Commands, click Exceptions and then click OK.
But in stage 6, in Commands there is no Exeptions
Also I tried to remove Enable just my code, And it didn't work.
Just a FYI ---
Im am using VS Express 2010 (VB) and didn't see the debug exceptions.
Based on the screen shot above I just pushed CRLT-ALT-E and it opened.. (!)
Its a bit unclear to me, if VB 2010 Express has this option or not, or how to unhide it, but the key click combo opened it.
I was then able to turn off the option I needed
In my case the "PInvokeStackImbalance"
enter image description here
Another user has reported the missing 'exceptions' on the 'debug' menu to Microsoft and actually got an acknowlegement from Microsoft (though not from the product team and not confirmation that it is a bug).
https://connect.microsoft.com/VisualStudio/feedback/details/882780/exceptions-comman-missing-in-vs-2013-express-for-web
For what it's worth, you can add your vote to this report at that site; I'm experiencing this problem and I have done so too.
Here's a potential work-around: the 'exceptions' is present in the Visual Studio Express for Desktop. And you can install that edition side-by-side with Web edition. If you can figure out a way to invoke your project executable from the debugger in the Desktop edition, you'd have control over exceptions there.
The exceptions menu isn't shown in Visual Studio Web Developer Express. It is only shown in Visual C# Express.
You can however break on all exceptions. You can try to turn off "Just My Code" debugging, which will catch exceptions thrown in CLR code and linked libraries.
To do this, open Tools -> Options -> Debugging -> General, and uncheck "Just My Code" (or Enable Just My Code).
if it doesn't work try
Debug -> Exceptions -> Common Language Runtime Exceptions - check "when thrown"
if you don't see exceptions try to change your settings following this guide
Refer here for documentation.
update
if it still not working try this
Tools menu >> Import and Export Settings >> Reset all settings. Then choose C# Development Environment.
Many of the customization and integration features for Visual Studio's IDE are not available in the free Express editions, but you should be able to get to the Exceptions menu easily enough without using them.
Press F5 to start debugging, then select Debug / Exceptions... Turn on the check box for "C++ Exceptions" "Thrown". Hit "OK"
I am new to VS.
Went to Extensions and installed JSLint.NET, it is also enabled.
But I get no item under Tools to configure or use it?
JSLint.NET is configured on per project basis. Right click on your project and you should see a menu choice for JSLint.NET Project Settings.
You can see an example of this on the Visual Studio gallery page for the extension.
JSLint.NET Extension