I have VS 2015 Community using C#. I created a WPF application.
When I hit F5 or play Visual Studio starts to debug the application as normal. I even see the Diagnostics showing Memory Usage and CPU (but it locks up, for example at 20 ms and stays there). The problem is that sometimes the application will open and run when debugging, most the time it does not. Important to note that visual studio itself isn't locking up, just the diagnostic tool window.
If I run without debugging the application opens as normal and there are no problems, but if I want debugging the application doesn't even open.
I am sorry I have no errors to show because I get no errors or warnings. It simply just wont open during debugging.
Is there a patch/update I missed or has anyone had this problem before?
I had what sounds like the same problem. I disabled Enable Diagnostic Tools while debugging in Tools → Options → Debugging. In my case it was some kind of conflict with Symantec (per the event log). Not ideal but being able to debug is better than having diagnostics.
UPDATE
I looked up the help desk ticket I filed for this incident and it was not the event log, I remembered that incorrectly. What was happening was that the edpa.exe process (a Symantec process which is controlled by group policy at my office) was thrashing the processor whenever I would debug. The fix/workaround is the same. I have since got a new PC and I do not experience the problem.
Have you tried restarting Visual Studio / PC or re-building the solution?
It may help.
There should be no conflict with Symantec NIS (current version 22.6.0.142). It (your question submittal plus the accepted answer) sounds more like an available memory issue; my NIS reports high memory usage when I start up VS, so I sometimes (not always) have Diagnostics failing to start up, but debugging always would continue. Perhaps adding more physical memory is the solution for you; but for now, turning off Enable Diagnostic Tools While Debugging is just a bandaid.
Related
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.
After using VS2015 snapshot and profiling tools, I can't seem to get the diagnostics tools to work again. Every project, even new ones just say the following
The Diagnostic Tools window does not support the current debugging
configuration.
Tried creating new and different type projects, running as administrator, deleting program data, app data, repairing and re-installing from uninstall.
Anyone experienced this?, shame as they've improved this tool a lot in this version.
So I resolved my issue. The Diagnostic Tools window currently does not support:
Windows Store projects that are using JavaScript
Windows Store projects that are running on a Windows Phone
Debugging with Use Managed or Native Compatibility Mode
In my case I had 'Use Managed Compatibility Mode' enabled. To change this go to the following and uncheck the 'Use Managed Compatibility Mode' or 'Use Managed Native Mode'.
Tools –> Options –> Debugging -> General -> (Un-check) 'Use Managed Compatibility
Mode'
I had the same problem but didn't have checked 'Use Managed Compatibility Mode' option. I had small research and seems like if start visual studio in Administrator mode, I'm able to use diagnostic tools. To start in Visual studio in Administrator mode just right-click on the studio icon and click on Run as administrator.
I encountered this error message in VS2017, but none of the above solutions worked for me. However, I did eventually get it to work.
It seems this tool can actually be attached to any process on the computer's CPU, not just the program being run by VS. So without specifying that you want to run diagnostics on program you're running from VS, it throws this error message.
Initially, I went to Debug > Windows > Show Performance Tools, and when I tried to run my program in the simulator, it would display that error message: "diagnostic tools window does not support the current debugging configuration". I tried going to Debug > Options and turning off the "Use Managed Compatibility Mode" feature, but it was already unchecked (and grayed out), and I tried running VS as an administrator, but it behaved the same.
Eventually, I found a post suggesting "Attaching to Process", which is what ended up working. I went Debug > Attach to Process, which opens up a window that lists a large number of available processes. I couldn't find the simulator that was running my program manually, so I opened my Task Manager, and found it: "qemu-system-x86_64".
I hit "Attach", then went back to Debug > Windows > Show Diagnostic Tools, and I was getting the stream I wanted. From there, I could take snapshots of my memory usage, and I had an easy way to observe the state of my program's memory leak problem during debugging without waiting for actual lag to build.
Cheers.
Running Visual Studio as administrator fixed this for me.
For me it was PostSharp 4.3 (alpha) breaking the "Diagnostics Tools" window.
Thanks for the pointer! For me, it was the other way around, though. "Use Managed Compatibility Mode" was unchecked. Checking it got rid of the error and the debugger started working again.
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"
From time to time I receive this error message when I'm debugging my Console Application:
The process cannot access the file 'bin\Release...' because it is
being used by another process. Exceeded retry count of 10. Failed.
The fact is that it's not running and Visual Studio keeps showing this message, and so I have to restart it and build it again.
The process is NOT running, so there is no reason to receive this error.
Does anyone know why this is happening?
Verify that nothing has changed the file permissions, and the file isn't read-only. Verify that you cannot delete the file yourself. If so then yes, something is blocking it.
Download handle.exe, which is a command-line tool that shows you what process is locking a file.
If handle.exe says nothing is using your file, or it says devenv.exe is using it, then I think you have hit that intermittent bug in Visual Studio. Your only option is to restart Visual Studio. If you do a google search for "used by another process" with site:connect.microsoft.com you will find that this bug gets reported, then fixed, then reported, then fixed - over many years. Personally, I have had this happen most often on VS2010 using WPF projects. It has yet to happen to me on VS2013. So upgrading might help.
Here is my Google search.
If the process is not running, I suppose Visual studio is the process that uses bin\Release.
If you want to know exactly what the problem is, delete everything in the folder (if possible), the file that will not be deleted will be the one that is used by Visual Studio, this will already be a good indicator.
I'm not sure why you are debugging the release build?
When this happens, it usually is due to being opened i.e. the console window that has ran the app is still open, or it is still in the process of closing.
However, again I feel it's due to debugging a release built application.
I had a similar issue in the last couple of days. The reason this happened to me is because I was testing a Windows Service I created. When I forgot to stop the service, and tried to build, I got this error.
Follow the suggestions in the other posts. As well, you may want to download Process Explorer from Microsoft - It might give you additional insight and allow you to kill any linger process.
What version of Visual Studio? You tagged it as VS 2013, correct?
Did you look at the following threads at Microsoft? Many complaining about similar issue.
https://connect.microsoft.com/VisualStudio/feedback/details/533411
http://connect.microsoft.com/VisualStudio/feedback/details/811846/visual-sudio-cant-complie
http://connect.microsoft.com/VisualStudio/feedback/details/647826
I have a relatively simple WPF application. Whenever I launch it from within Visual Studio 2012 (in Debug or Release mode), it is very slow to start up (can literally take minutes).
There is some custom initialization work done (reading files and loading data from a SQLite database), but it should be completed within 1s as it takes less time than that when I launch the application directly by clicking on the Debug/myapp.exe file.
The strange behavior is that if I break the execution and immediately continue ("play" button in the IDE), the window will load instantly.
If I press F5 "Start Debugging" the problem will arise, but it will load instantly if I press Ctrl+F5 "Start without debugging".
I am using .NET 4.5 in x86 mode.
I tried profiling using dotTrace Performance profiler but the problem cannot be reproduced this way (it will load instantly).
Do you have any idea about what could be causing this?
On possibility for this slowness could be caused by having too many WPF Trace Settings turned on. If this is the problem, you can tell because the Output Window will be filling with information as the project starts up.
If this is your problem, you can adjust your Trace Settings by going to
Tools > Options > Debugging > WPF Trace Settings
Once you have found the correct section, you can turn the various trace options off and you should see an improvement in speed upon starting the application.
There could be a large amount of breakpoints set in code. Open the Breakpoints window (Debug->Windows) and turn it all off to see, if it's the reason.
Or even better, you can delete from disc the .suo user file, which stores breakpoints and session settings.
Another possible reason is a malfunctioning extension. You may want to try to disable some plugins to see, if it works better.
Also, I remember I experienced WPF apps start slowly from VS, if the active tab was graphical window preview.
In my case the problem was that for some reason VS doesn't cache symbols for System.Windows.Interactivity.dll and every time I start debug session they're downloaded from server. Navigating to Tools -> Options -> Debugging -> Symbols and selecting "Only specified modules" with empty module list addressed the delay.