can't start visual studio profiler - visual-studio

I have VS 2010 Ultimate. I have created empty win32 console solution and replaced it's cpp file with http://pastebin.com/EQJKJK6T I tried to perform CPU Sampling profiling. But for some reason I get the following messages
MessageBox:
Could not launch 'path to exe file'. Previous attempt to profile the
application finished unsuccessfully. Please restart the application.
Output window:
Profiling started.
Warning VSP2355: Some Windows counters will not be collected. Without this data, some performance rules may not fire.
Profiling process ID 4368 (test).
Process ID 4368 has exited.
Data written to e:\projects\test\test101224.vsp.
Profiling finished.
PRF0025: No data was collected.
Profiling complete.

I had this issue, yet bizarrely it only affected one Visual Studio solution. Using the profiler with another Visual Studio solution worked fine.
I tried:
disabling Symantec
uninstalling VMware Player (as mentioned above)
but neither worked.
In the end I amended the registry, setting HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SysPlant\Start to 4 and rebooted, it then started working.

Related

Visual Studio CPU Profiler / No Data

Today my CPU Usage Performance profiler in Visual Studio stopped working. I start it, it seems like it's working, you can see the graph of the CPU going up and down but when it finishes I get no data with the message:
"There is no data in the current set of filters."
I have tried every combination of categories and filters with no luck. I restarted Visual Studio, I rebooted the workstation, I tried against a new hello world project. Other performance tools seem to work (e.g. the .NET Object Allocation Tracking tool works). To (try) to rule out that it was something specific in my project I was able to successfully run it on a 2nd workstation against the same set of code. I have also run VS without extensions and also in regular mode after disabling everything I've added in (like ReSharper).
Edit: Additionally I just found this in the Windows Event Viewer.
System.Runtime.InteropServices.COMException: The method or operation is not implemented., System.Object get_Value()
at EnvDTE.Property.get_Value()
at Microsoft.VisualStudio.PerformanceTools.ProjectTarget.LoadBinaryProject(IVsHierarchy hier)
at Microsoft.VisualStudio.PerformanceTools.ProjectTarget.LoadProjInfo()
This also just popped up in the Event Viewer under "Windows Error Reporting" that referenced a Watson VSTelem.Out error:
Fault bucket 125730739576, type 5
Event Name: PerfWatsonVS12Data
Response: Not available
Another oddity is, I just ran a profile session for maybe 20 seconds, however when it's done VS says "Diagnostic session: 127:47 minutes" which would be the about the time I first time I tried it this morning if it never stopped. I did a repair of Visual Studio from the installer and the profile worked for 1 session after, the 2nd session then reverted to the aforementioned behavior again.
I'm currently using:
Visual Studio 16.8.5 16.9.1 16.9.2 16.9.3 16.9.4 16.11.2
.NET Core SDK: 5.0.201
Windows 10 Version 2004 Build 19041.867
Any thoughts on fixes?
Edit: According to the following link, it might be related to a Windows Update and a bug in my NVidia driver:
https://developercommunity.visualstudio.com/t/no-data-in-cpu-usage-tool-windows-update-related/1384519
Microsoft confirmed the problem, as soon as a solution or workaround is found - report it. Follow the forum https://developercommunity.visualstudio.com/t/profiling-cpu-still-states-no-user-code-was-runnin/607535?from=email&viewtype=all#T-ND1373491

Windows Forms application responds very slowly when Visual Studio debugger is attached

I recently changed my work computer and I'm struggling developing with Visual Studio 2019.
This is a simple operation that highlights the problem. This happens when application is in debug mode with debugger attached.
As soon as I detach the debugger (Debug > Detach all in VS) the speed returns to normal. Speed is OK also with the installed version of the software. I tried using the Performance Profiler to see where the time is going but since the debugger is not attached in that configuration speed is fine there too.
I must add that only some operations, like the one pictured, are incredibly slow. In many cases the application runs as smooth as the installed version.
I've compared every option under Tools > Options > Debugging with my previous computer and one colleague and they match perfectly. The operating system is the same, Windows 10, and the installed version of VS is the same.
I tried cleaning the build, removing the .vs folder, repairing Visual Studio with no luck. I've always used a desktop PC (my last one was an I7 8xxx), the new one is a laptop with Ryzen 7. Other colleagues have a laptop with Intel processors and they show no issue.
Any help would be greatly appreciated.
As pointed out by Hans Passant in a comment, this was due to an excessive amount of lines written in the debug window. Lines of log written to an external file (via an Enterprise Library logger) were echoed in the debug window, so I think the whole process was waiting for that window to be constantly updated.

Microsoft.VsHub.Server.HttpHostx64.exe consuming loads of resources and crashing Visual Studio 2015

I am experiencing this behavior for some days now.
Microsoft.VsHub.Server.HttpHostx64.exe goes bananas consuming resources and Visual Studio stops responding and crashes when a breakpoint is hit.
I heard this process is related to performance analysis but even if I disable it the problem keeps happening (even though it shouldn't crash VS neither debilitate the user interaction).
Anyone had the same problem and found a solution for this?
VS2015 has a bug which allows the task named Microsoft.VsHub.Server.HttpHost64.exe to consume all the free ram so your computer pages to disk and slows things down. When I killed that task it had no adverse effects on my program, and reduced disk activity from high levels to low levels. The task may restart itself, but instead of consuming 10+ GB of memory, it then consumes about 40MB. The bug only appears when running the GUI / IDE, not your compiled program.
It may be possible to programatically kill that task, haven't tried it.
Also, here is another possible workaround which can be seen at https://connect.microsoft.com/VisualStudio/feedback/details/1610160/microsoft-vshub-server-httphostx64-exe
** The following may require you have administrator privileges on the box ***:
1. close all instances of Visual Studio 2015
2. Locate directory C:\Program Files (x86)\Common Files\Microsoft Shared\VsHub\
3. Rename VsHub to VsHub-Suppressed
Once the above has been performed, Visual Studio 2015 will start noticeably quicker.

Visual studio 2015 high cpu consumption when idle

I have visual studio 2015 enterprise edition, update 1.
When idle, the visual studio process is using around 10-15% cpu constantly.
I tried the solutions provided here with no success.
The solution includes 11 c# projects.
The issue seems to appear only after the first compilation after the solution.
In my case a few *.mdb files had been added to the solution which triggered a constant cpu usage of 30-35%.
So generally the content of a solution triggers background tasks which can lead to high cpu usage. If that usage occurs suddenly, it's worth to get maybe an older source version to check, if the problem is related to added files.
In my scenario the visual studio process remained active using cpu even after closing visual studio. Using process explorer I identified two threads using the cpu indicating following start addresses:
clr.dll!CreateApplicationContext
devenv.exe!IsAssertEtwEnabled
After a lot of attempts and tests to fix this issue, I finally discovered the source of it.
I had a Code Map dgml file in the solution.
Removing the file fixed the issue, and now the devenv process cpu consumption returned to normal.
UPDATE:
After some time working, it seems that just removing the Code Map dgml didn't entirely solve the problem. The solution at last was to remove the reference to the "Modeling Project" containing it(along with other documents such as Sequence Diagrams...).

Visual Studio 2015 not responding

I have recently installed Windows 10 in my DELL laptop. I see quite often Visual Studio 2015 not responding.
Is there a log that I can turn on to see what's happening in the Visual Studio while loading a project, to see any add-on delaying the load? Or something like that in the Task Monitor to see which resource is causing the slowness like disk read or memory?
UPDATE:
As per IInspectable's comment, I created a dump file from the Task Manager.
I don't see any thread information in this file. I tried to debug (by clicking debug from the actions menu) after loading the data in VS 2015 again. That takes a while to load the symbols, but at the end I see Source Not Available screen and stop there.
11/18/2015: Asp.net tools team is working on this performance issue.
You could try enabling logging via the /Log command line option of the devenv.exe. See the Microsoft reference. (devenv.exe being the Visual Studio IDE)

Resources