I just upgraded to Visual Studio 2022.
When running a project (developed in VS 2019) I get the following error/warning message:
enter image description here
You are debugging a Release build for APP_Name.exe. Using Just My Code with Releasae builds using compiler optimizations results in a degraded debugging experiance(e.g. breakpoints will not be hit)
Since I am fairly new to C#, I am lost as to what to do. The only "solution" I found online was to disable "Just My Code", but that seems to not be able to debug correctly.
Any suggestions would be greatly appreciated.
Please setting the configuration to Debug in the Configuration Manger window.
Related
There is an issue with my Visual Studio / Test Property Page. Which is I guess one of the root causes to not discovering any of my tests, in any of my projects. So this means it is not related to one Project, or to one nuget package on the projects. I am not sure when the issue first occurred, but I am suspecting, after some Visual Studio updates.
After following some of the possible solutions on SO, related to the Test Explorer, the tests itself and the Test property Page. I found the following:
When I go in Tools -> Options -> Test. I have the error shown above.
Error: "An error occurred loading this property page"
It is not an issue of missing nuget packages. Because it is happening in all of my projects.
The latest .NET framework is installed
All of the questions on SO, related to this topic, didn't have something that could help me solve this issue. Unless I missed something, which is quite possible.
Re installation of Visual Studio itself didn't help. The issue persists.
Deleting VS test cache files DEL %TEMP%\VisualStudioTestExplorerExtensions
Restarting VS
Test -> Test Settings -> Default processor architecture is set to x86
Based on my research, I find a case which has the same error message with yours. The issue was resolved by running “devenv /setup” in Visual Studio 2017 Command Prompt.
I’m not sure if this works on you machine. Please try it, I do hope it is helpful.
It worked for me! (On VS 2019 version)
Open Developer Command Prompt for VS 2019 Preview
Run devenv /resetuserdata
I encountered the same problem in Visual Studio 2019. I was helped by the "Visual Studio 2019 Command Prompt" with the "devenv /updateconfiguration" command. After that, when I started the Visual Studio, there in the settings the Test tab worked.
I spotted the solution here, but did only step 4:
https://github.com/dotnet/roslyn/issues/9421#issuecomment-191895696
I am working on creating a customized VSTS/TFS Check-In Policy. I followed the guidance given from this answer on how to create the check-in policy. Basically, I downloaded the source code from Colin's ALM Policy and made a few modifications to see if I can get it to work.
When I build the installer (vsix) and install the extension, this works just fine (tested against VSTS). However, I want to be able to debug the policy so that I can make modifications and bug fixes more quickly.
The answers given to a similar question seem to work for Visual Studio 2015, however this does not work for Visual Studio 2017; if I set the debug start action to launch Visual Studio 2017 devenv.exe, the check-in policy does not show up. The same check-in policy shows up with Visual Studio 2015 though.
I'm looking for any guidance on how I can debug this check-in policy utilizing Visual Studio 2017.
There is test project (ColinsALMCheckinPolicies.UnitTests) that you can debug. So just need to add breakpoints to the source file, then debug the test method (right click a test method > Debug test)
I hate answering my own question, however I feel it is necessary since this answer helped me out; I found the answer from the MSDN documentation :The Experimental Instance.
Basically, under the VSIX Installer project properties, simply setup the Debug start action and command line arguments using the /rootsuffix Exp argument:
If you do this, it launches the Visual Studio Experimental Instance with the VSIX already installed, and it attaches the process to your development environment too, which allows you to debug your extension.
Also, I agree with the other answer to this question, https://stackoverflow.com/a/43672469/347172, suggesting that a unit testing project will be highly beneficial. It definitely will help to ensure that your code is properly unit tested and working too.
I'm using Visual Studio 2015. I'm trying to use Diagnostic Tools and somehow that window is always blank. There is nothing displayed in that window. There is no error too. I tried the same with empty IDE, loading a project, and debugging the project but in all scenarios it is completely blank, just the window heading and nothing else.
I've seen other issues with Diagnostic tools such as this, and this but I can't find anybody facing issue like this.
I tried reinstalling VS and also checked by installing VS 2015 Update 2, nothing helped.
It would be great help for me if anybody got any idea why it is happening or what can I do to find the issue or fix it?
Product version: Visual Studio Enterprise Edition 2015 with Update2
OS: Windows 7 Enterprise Service pack 1
I have experienced this same issue with VS 2017. For me, the problem is that my laptop has a 4K display, but I'm also connected to exernal monitors that are not 4K. VS seems to have trouble rendering the diagnostics tool panel when I move the VS window around or connect/disconnect the external displays. If I restart VS and open it on the desired monitor, it starts displaying again.
Please try to enable logs for the diagnostics tools based on instructions here. Probably, log contents can provide some hint for the reason of the issue.
Starting VS2015 as Administrator worked for me as a workaround.
The only error that I found in logs (enabled as in Andrey's answer) was this one:
Error --- datawarehouse.cpp --- Path should be secure at this point: 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CLIENTDIAGNOSTICS\APPRESPONSIVENESS\..\MemoryProfiler\DataModel'
Otherwise logs looked fine, with entries of Debug and Info importance only and nothing suspicious.
I had the same problem, when I blocked with SRP executable file of Microsoft Edge WebView2:
"C:\Program Files (x86)\Microsoft\EdgeWebView\Application\110.0.1587.50\msedgewebview2.exe"
So, I you wish Diagnostic Tools working, you need to have Microsoft Edge WebView2 installed, or allowed it for execution.
To install it, run the file with arguments:
MicrosoftEdgeWebView2RuntimeInstallerX64.exe /silent /install
I started using Visual Studio 2010 and am missing the dialog box that used pop up in Visual Studio 2008 and earlier that would warn you if there are build errors. The text was something along the line of "There were build errors, would you like to continue using the last successful build?" Then you had the option to continue or cancel (and then go fix the build errors.)
VS2010 is immediately debugging with the last successful build when there are build errors. This is causing frustration for me. How do I turn this warning back on in VS2010? I looked through the options, but didn't see anything that looked like it would work.
This is the setting: Prompt to launch
tools - options - projects and solutions - build and run -"on run, when build or deployment errors occur"
I’m using visual studio 2008 and moles version 0.93. Everything works well except when I try to debug any test that uses a Moled type. The test skips all my breakpoints. And I get the following message in the output window:
Unable to attach. Check for one of the following.
The application you are trying to debug uses a version of the Microsoft .NET Framework that is not supported by the debugger.
The debugger has made an incorrect assumption about the Microsoft .NET Framework version your application is going to use.
The Microsoft .NET Framework version specified by you for debugging is incorrect
Please see the Visual Studio .NET debugger documentation for correctly specifying the Microsoft .NET Framework version your application is going to use for debugging.
If I try debbuger.Break () I get a message: "No symbols are loaded for any call stack frame. The source code cannot be displayed."
I’m in a crunch right now chasing an issue with one our main components and it has been a pain (like I need novocaine) trying to figure anything out without being able to step through the code.
I want to take advantage of mole's "smooth debugging experience". However, I can't seem to get the debugger to attach at all.
Thanks,
Bzz
See the solution to this issue here:
http://social.msdn.microsoft.com/Forums/en/pex/thread/91c08bf4-3260-458c-a221-91f030a75499
I had this problem when I moved a project from Visual Studio 2010 to Visual Studio 2008. Here's what I did to fix it.
Close Visual Studio. Navigate to the Debug/bin location. Delete the following files:
*.vshost.exe
*.vshost.exe.config
*.vshost.exe.manifest
Open the solution. Goto the project Settings. Under the Application Target Framework, select a framework lower than the one you are working with (you'll set it back later). Visual Studio will close and re-open your project automatically. Then set the Target Framework back to the original version you were working with. Rebuild all, and debugging will work properly.