Visual Studio 2015 diagnostic tools no longer working - c#

I have Visual Studio 2015 Community Edition Update 3 running on Windows 7 SP1 64 bit, which I use to develop C# applications.
I love the diagnostic tools during debugging to spot performance problems early on. However, they stopped working for me sometime in the last month or so (possibly related to installing Update 3, although I have no information to back that up). I see the error message "CPU Profiling while debugging is not available on this version of Windows. To see CPU usage details, run the CPU Usage tool without the debugger (Debug -> Performance Profiler...)."
Things I have tried without success:
Completely uninstalling and reinstalling VS.
Performing a repair on my VS installation
Ensuring "Use {Managed,Native} compatability mode" is disabled in debug options.
Enabling the Diagnostics Hub logging info as described in this question. No error messages that I can see appear in the logs.
This still happens even if I create a new WPF project, so I don't believe it has any project-specific cause.
Are there any other things I can try? Obviously they were working before, so I don't believe the error message about my version of Windows being unsupported.

Deleting my solution's .suo (solution options) file fixed the issue. My initial statement of this bug affecting even new projects seems to be wrong. Although, I did do a complete reinstall of VS after doing that test, so it's possible that impacted the outcome.

Full disclosure: I work at Microsoft, specifically on the Diagnostic Tools team.
There are parts of the Diagnostic Tools that won't work on Windows 7, specifically taking a CPU profiling trace while debugging. This is a limitation of the operating system and ETW. If you are just interested in the graphs and debugging events, those should work. You can turn on logging for our tools which might give you some insight into why they are not working:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0\DiagnosticsHub\LogLevel
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\14.0\DiagnosticsHub\LogDirectory
For LogLevel you can use one of the following strings "All", "Info", "Debug", "Warning", "Error" (In your case I would use All to better see what is happening). As for LogDirectory it is a directory of your choice "C:\Logs". When your done reproing the scenario, close VS to flush the logs and don't forget to delete these keys as the diagnostic tools logging is pretty system intensive.
You should be able to search for "Error ---" in the logs to get an idea of what is happening. We have seen problems with certain VS extensions and custom projects.
Also, feel free to also post the issue at: https://connect.microsoft.com/ Each issue that is received there gets turned into a bug and assigned to the corresponding team.

I had som issues with that a while ago.
1) Check Tools>Options>Debugging>General>Enable Diagnostic Tools while debugging
2) Check Tools>Options>Intellitrace>Enable intellitrace

I had the same issue, although deleting the .suo file did not help, I also repaired Visual Studio 2015 Professional and then it worked. So for future readers, if deleting the .suo does not help, try to also repair Visual Studio and vice versa.

None of the others worked for me. What I had to do was close all Visual Studios and re-opened it and the diagnostic tool worked.
(I deleted the .suo file, made sure all the correct options were enabled, but because I had another Visual Studios session running, none of it worked until I closed all)

I had already another visual studio instance running with diagnostic one. That was the issue for me.

I faced this problem today and it was not easy to find working solution.
This helped to me:
Reinstall Cumulative Servicing Release for Microsoft Visual Studio 2015 Update 3 (KB3165756)
Direct link to download: http://go.microsoft.com/fwlink/?linkid=816878.
After Repair action (I had it installed before, otherwise install) prompted to restart computer, did it and Diagnostic tools worked again.

I had a similar problem with Visual Studio 2015 Pro Update 3 running on Windows 10 Home. The runtime display of memory and cpu usage stopped working. Deleting the .suo file fixed the problem, as indicated by proc-self-map's answer. The .suo file was buried in the .vs hidden directory so I removed the whole .vs subdirectory. Now the runtime display of memory and cpu usage works like a charm again. No reinstall required.

Related

Build is Stuck in Visual Studio 2015

I have this build Machine at a remote location. The process of building a full install is that first I update my code via SVN update and then open Visual Studio 2015 Enterprise and build the solution in Release Mode, once that is done I would then open Advanced Installer to build the package to an executable.
But from Friday I am unable to build my code with visual studio 2015, it would seem that build is happening but I am not seeing Build Successful, its been an hour and I had to kill the process(devenv) to Cancel the build.
The only delta which happened from last time is that SVN in my organization is running into some issues in which writes are failing, but logically it doesn't make any sense that visual studio wouldn't build a solution because there is an issue with SVN. I mean, one can argue saying that maybe there is a read error too but I am positive that I have all the necessary code files to build the solution, and for the sake of argument if we say I hadn't, shouldn't I have run into build errors rather than a hung build?
Note 1: Output window is of no use, as I do not see any meaningful error.
Note 2: I checked the solution out in another directory but same result.
Note 3: Build Machine has Windows 7 Professional SP1 in it.
Any insight to this weird behavior is appreciated.
I was able to build the solution after restarting the Build Machine. I looked into the system log to see when was the last time the computer was restarted and to my surprise, I found that it was never restarted even once. I had been using this Machine at least from 2 years.
As I wrote, restarting the PC solved the issue but I do not know the reason which helped the case here. I am guessing there were memory leaks?
Any person reading this post to solve similar issue may want to start by restarting the Build Machine.

Visual Studio 2017 is not executing any code nor generating any meaningful errors

I am having trouble with Visual Studio, so I created as simple a program as I could. I created a Console Application that should display a single line to the console, then wait for the user to press a key. Instead, it gives me an error message.
I looked up the error message, and it is discussing an invalid handle. I am not sure what handle could possibly be invalid. The code is not in any way complex (and would have worked without issue any other day I've used Visual Studio). I have no clue what could have possibly caused this issue. I have not used Visual Studio in about two and a half weeks, but I still cannot fathom what could have happened to it in that time.
Here is a screen shot of the error message:
I've been to Microsoft Help and Support web sites (although I did not find any web site specifically named Help and Support, but I did find MSDN and the various forums). I looked up that HRESULT. In every article I read, it is discussing some Web application error. I have yet to come across a single article that mentions this occurring in a Console application, which is why I am so stymied. My next step is to try to repair my installation of the .NET Framework to see if that does anything (I found some oblique references saying that may help). If anyone else has any ideas, I am very interested!
Additionally, I tried this same code in Visual Studio 2013. It runs fine with that IDE. It only fails with Visual Studio 2017 (which I have had nothing but problems with since installing it, and uninstalling and reinstalling it). But, my copy of VS 2013 is the Community edition, and my job just purchased the Professional license for 2017 for me, so I would prefer to use that if I can ever get it to work. It is quite frustrating at this point. If I cannot find any other answer, my next resort is uninstalling it and reinstalling it again. This will make the fifth or sixth time that I have needed to do that, so I am hoping for another solution.
Edit:
Doing more research, I discovered it is only an issue when debugging code. If I run code through Visual Studio using the 'Start Without Debugging' option, it runs without issue. And since I am able to use VS 2013 on the same machine in debug mode without issue, that seems to rule out a Windows issue. The issue is probably confined to VS 2017.
I have plans to uninstall and reinstall VS 2017, but that is a lengthy process. So, before I do that, I am still looking for any other possible solutions.
UPDATE:
I found the crash report in Event Viewer. Here is the log:
Fault bucket 2243818120991372909, type 1
Event Name: APPCRASH
Response: Not available
Cab Id: 0
Problem signature:
P1: HelloWorldTest3.exe
P2: 1.0.0.0
P3: cc00d718
P4: StackHash_cad8
P5: 0.0.0.0
P6: 00000000
P7: c0000008
P8: PCH_E2_FROM_ntdll+0x0006A2DC
P9:
P10:
Attached files:
\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERB1A6.tmp.dmp
\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERB427.tmp.WERInternalMetadata.xml
\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERB486.tmp.xml
\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERB494.tmp.csv
\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WERB4D3.tmp.txt
These files may be available here:
C:\ProgramData\Microsoft\Windows\WER\ReportArchive\AppCrash_HelloWorldTest3._40a823464c1b7f1a36d57ccec8a525baac94eb58_92da583c_48deb87c
Analysis symbol:
Rechecking for solution: 0
Report Id: a085ff02-7bff-4a22-8d90-3f52094b2f8f
Report Status: 268435456
Hashed bucket: 334244e30a9d2a234f23a4b15a46766d
Cab Guid: 0
Does this tell anything about why it crashed? I also have a list of .dlls that were loaded at the time, but I cannot see anything in particular that would cause it to crash.
UPDATE #2:
I tried rebooting in Safe Mode. That fixed the issue. So, then I tried restarting services one-by-one to find the one that was causing the debugger to crash. But, Windows would not allow me to start any additional services in Safe Mode. So, I decided to try it in the opposite direction. I rebooted in normal mode and started turning off services one-by-one. In the end, I had every service Windows would allow me to turn off set to off, but the issue was still occurring. This is looking more and more like a Windows Update broke something.
UPDATE #3: We activated our Microsoft Technical Support Contract. The Support Engineer they assigned had me send memory dumps and results from running Procmon during the APPCRASH event. After I sent the information, I have yet to hear back and still no word on what could be going wrong. The engineer has been ignoring my emails for the past two days (Friday last week and Monday this week). So, I cannot even get an update on progress. This is an extremely frustrating issue to troubleshoot, as it does not really generate easily found error messages. I will keep updating as I learn more. Thanks to all who have tried to help.
UPDATE #4:
Microsoft reviewed the dump files and the Procmon results. They discovered the error is in the CLR (which is odd, because VS 2013 can debug without issue...) It is specifically in the following dll method:
win32u!NtUserMsgWaitForMultipleObjectsEx
Microsoft says the dump did not contain the details of that issue, and they would continue working on the issue. In the meantime, I uninstalled Trend Micro, restarted my computer, uninstalled VS 2017, restarted my computer, reinstalled VS 2017, restarted my computer, and the VS 2017 debugger still does not work. I also repaired every .NET Framework version in case any of them were corrupted, restarted again, just in case I hadn't rebooted enough, and still no luck. The only thing that has worked is booting the computer in safe mode.
I know it has been two years, but I forgot about this after the issue was solved a couple of weeks later. Microsoft eventually found the issue was software my company was using to monitor employee activity, Veriato.
Once they disabled that software, Visual Studio worked without issue. Veriato eventually released a patch for it. But, it was software I was not even aware was on my machine because it has a similar code pattern to a virus, so it hides. Microsoft even had trouble finding it. Eventually, our IT department recognized the name of one of the files and put it together that was what was causing the issue.

Visual Studio stopped running my programs

Scenario: I hadn't been coding at home in a while and wanted to kick off my first server client application in C++ using the Visual Studio 2012 Express. But when I clicked the run button, VS froze. There was nothing wrong with the code, so I think the problem lies in some VS settings I'm unaware of, or I accidently downloaded an update which made things worse.
Issue: Hitting the play button (Debug Win32 selected) freezes the VS. Also the taskmanager gets 3 processes of the running program (none which I can interact with). Those processes cannot be terminated unless I reboot the computer.
Specs: Visual Studio 2012 Express, Windows 7, 64 bit. Avast Premier 2015.
#include <iostream>
int main() {
printf("tilt");
return 0;
}
Self-Debugging: I tried making new Hello World programs in new projects, but the issue was still there. If I opened an old project I knew worked before, it also had the same issue without me modifying anything. I changed to C# but still I couldn't run a simple program. I repaired my VS. I installed Visual Studio 2015 Community, but still cannot run any programs.
Error messages:
the process cannot access the file because it is being used by another process
visual studio could not copy exceeded retry count of 10. failed
Microsoft.Common.targets(3390,5)
Linker Tools Error LNK4098
error LNK1168: cannot open tiltTest.exe for writing
error LNK1181: cannot open input file 'kernel32.lib' //after repairing VS
Related links:
Visual Studio Hangs in debug?
Visual Studio 2015 freezes when debugging a cpp code
Windows Forms application remains alive in task manager after hitting "stop debugging" button
Visual Studio "Could not copy" .... during build
Resolving LNK4098: defaultlib 'MSVCRT' conflicts with
visual studio linker warning LNK4098
http://www.bytemedev.com/how-to-fix-visual-studio-error-the-process-cannot-access-the-file-because-it-is-being-used-by-another-process/
Final Words: I'm really bad at linking, settings, libs and anything that isn't code. So if you know how to solve it using those, please expect me to be really beginner as all that is totally confusing and illogical to me. Help would be really appreciated ! If the solution is found, I will modify this post so others will find the solution as well.
Solution: I reinstalled the Visual Studio and turned off Avast, which solved my problems! Thanks for suggestions!
Given the error message about another process using the file it could be down to the antivirus software trying to scan the files at the same time that Visual Studio is trying to access them.
I'd try turning off Avast (or any other anti virus) first. (If you're paranoid about viruses disconnect the computer from the internet).
If everything now works add an exclusion to the AV of your source folders so that it doesn't scan your code - after all you know that there are not going to be any viruses in the executables you create (right?). This will also have the added benefit of speeding up your compiles/links as the AV isn't checking the (potentially) 100's of files you could be modifying each time you build.

vshost.exe not terminating properly in Visual Studio 2015

I am in charge of testing VS 2015 and how it works with our current applications for my employer. We currently use VS 2013 for everything we have, so I know there are no issues there. The problem I am having is that it appears the vshost.exe isn't terminating correctly or something. I have not narrowed down the exact issue but so far that is what I believe.
Here is how I get my error:
Run my app in debug
Open a few windows
Hit the "Stop Debug" button (the little red square)
Clean Solution
Rebuild Solution
After my rebuild I get the following errors in the EXE:
Error Could not copy "obj\Debug\APP.exe" to "..\..\bin\APP.exe". Exceeded retry count of 10. Failed.
Error Unable to copy file "obj\Debug\APP.exe" to "..\..\bin\CRM.exe". The process cannot access the file '..\..\bin\APP.exe' because it is being used by another process.
If I open the Task Manager and manually end the vshost.exe process I can successfully rebuild again, no issues. If I take the same steps, however, I am no longer able to build.
I tested these steps in 2013 and did not have an issue.
Also note that disabling the "Enable the Visual Studio hosting process" does alleviate the issue, however I do not want to disable this option.
Has anyone else had this issue? I know we are still early in release. Any suggestions/solutions to try? Is it possible there is something wrong in our code (which I highly doubt since I would then get the error in 2013, most likely).
Thanks for any help I receive!
EDIT: This is a WPF application written in .Net 4.0 using C#. Also, I have verified that the issue also occurs if I exit the application normally (IE I open a window then close it with the shutdown mode on LastWindowClosed)
SECOND EDIT: This is a new issue that presented itself in Visual Studio 2015 with the addition of the new live diagnostic tools.
I have found that if I have the "Enable Diagnostic Tools while debugging" option enabled in the debug settings I get this error. If I disable this option, the error goes away. I am not sure if this is a bug in Visual Studio but I would assume so, unless I need to do something else to shut them down properly. If anyone has comments or concerns, feel free to leave a note.
Probably late for the original question (and I see that he had a workaround), but as per MSDN, VSHOST.exe is only an enabler for improving Debug performance or facilitates scenarios such as partial trust debugging. If you do not need that support or can bear the cost of starting a process and attaching the debugger on each debug session, go ahead and disable the hosting process from project designer -> Debug -> Clear the box "Enable Visual Studio hosting process"

Visual Studio Freezing On Opening Project

My Visual Studio seems to be freezing/lagging when I open a existing project. I have added NHibernate framework into my code and it seems to lag my computer (at least that's what I think). When I open other projects, I do not lag or freeze at all. The freeze is about 3- seconds to a minute, then it will open my project and it will just act very slowly, it might take 20+ seconds just to switch classes an 20+ more seconds just to type a single character into visual studios.
I was wondering if anyone has had this problem before. If so how did you fix it?
I can't really work on my code until this is fixed. Oh also, when is save the code, it freezes for a good minute or two also.
You can see exactly what VS is doing at any given moment, if you attach a debugger to the devenv.exe process and hit Break when it hangs. Then load the symbols from Microsoft Symbols server and show the call stack for the VS main thread.
I wrote a very detailed article about how to debug crashes and hangs here:
http://blogs.msdn.com/kirillosenkov/archive/2008/12/07/how-to-debug-crashes-and-hangs.aspx
From the call stack it should be obvious what is causing the delay.
For me, removing the suo file (from the v14 sub directory) solved the problem...
Had the same problem. Closed Visual Studio 2010, opened again Running as Administrator, went to Extension Manager, uninstalled Nuget Package Manager, restarted Visual Studio 2010 running as regular user, opened problem solution, solution opened fine.
Nuget Package Manager seems to be the cause. My problem solution is using EF 4.3 Code First which interacts heavily with the Package Manager Console, but that may just be a coincidence.
As answer by Visual Studio 2015 Freezing White Loading Solution delete the .vs hidden directory solved the issue for me.
I am using Visual Studio 2017 Community Edition.
I had a hunch that something had been corrupted with one of my NuGet packages, and completely deleted the \packages subfolder and its contents. When I reopened the solution, all projects loaded successfully without hanging.
From there, I restored the previously deleted packages from the NuGet Package Manager Console and I was back up and running.
What, if any Add-ins do you have installed?
Edit:
One suggestion I would have then is to systematically disable each of your add-ins and see if performance changes and if it does research the culprit and see if there any updates available.
Uninstall any MS Enterprise Framework addin's you may have.
Delete the VS temp directory (and the Windows one).
Do you use TFS? Perhaps the server is a bit sleepy, that will make it freeze for a few minutes, but is ok afterwards.
For me, a chkdsk /F /R (which will prompt you to restart) and about 30 minutes of company time fixed this issue.
I think a few improperly closed instances of Visual Studio may have attributed to the issue.
I had same problem. Delete following folder.
C:\Users\UserName\AppData\Local\Microsoft\VisualStudio
My local files somehow became corrupted for one project, fortunately I didn't have any pending changes so rather than run chkdsk I just deleted the folder and checked out the solution from source control again.

Categories

Resources