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"
Related
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.
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.
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
When I hover my mouse over a variable when debugging a C# app in Visual Studio nothing popups. I expect to see the value of the variable (aka datatips). I'm running Visual Studio 2012 Ultimate (trial edition) on Windows 7 64bit. Does anyone know what may prevent them from showing?
Things I've tried to no avail:
- Reinstall VS
- Search for an enable/disable setting but there doesn't seem to be one
I can see the datatips correctly with the same C# project on Windows 8/64bit with the same version of Visual Studio.
THis helped me: you need to open in VS Tools | Options | Debugger | General and enable the flag [Use Managed Compatibility Mode].
Before running the application check you are running it in Debug mode. If set to Release mode change it to Debug and then run. The debugger will then provide the data-tips.
I have found this solutions:
reinstall Visual Studio as advised here, but you have already tried it
Open your VS->Tools->Import and Export Settings Wizard->Reset all settings->No, just reset settings, overwriting my current settings-> Choose a Default Collection of Settings from MSDN Forum: Debugging - hover watch has stopped working
maybe you have Release build configuration
set Code Optimization property to Disabled under Project property windows
as advised in similar question on SO
I had this problem so I deleted all the *.suo and *.user files I could find in the solution directory and that seemed to fix it.
I had this same problem. My project had somehow gone into Release mode, so I changed it back to Debug mode via Build|Configuration Manager and it was working again, the datatips reappeared.
I realize this is an older post. But I have the exact problem in Visual Studio 2019. The funny thing is that datatips are not showing on my external screens. But if I drag Visual Studio to my laptop screen, it shows without problems. Dragging it back to one of the two external screens and it won't show.
I also have a problem that the Project Properties and Team/Source Control Explorer does not show anything but white content until I switch to another tab and then back. Then it loads. I have tried enabling GPU support in Windows, but nothing.
Has anyone had the same experience?
I will of course try all of the suggestions for the datatips thing, as that's really decreasing my effectivity.
The same happened to me but only with C#, active mode administered compatibility (Managed Compatibility Mode) and it worked well, then I wanted to modify the code while had debugged and came out a motioning message
compatibility mode administered is not supports edit and continue
Then turn it off again, under native support is (Use the legacy C# and VB expression evaluators) enable this option and you can see the value of objects and edit code debugging.
Try deleting the .vs directory and restarting visual studio.
This 3 combinations solved it for me.
- Make sure you are in Debug mode
- Uncheck/Disable Use the legacy C#,VB.NET evaluator (Tools->Options->Debugger)
- Make sure Enable Just My Code is checked.
Using remote debugging on another machine makes it more challenging.
This thread talks about RPC Server being unavailable when using "Use Managed Compatibility Mode", which makes remote debug impossible with Managed Compatibility Mode
Remote Debugging not working. "Unable to attach to process. The RPC server is not available."
Native compatibility had the same effect.
It was only "Use legacy C# and VB expression evaluators" that allowed hover over variables AND remote debugging in my case.
I deleted the project and re-cloned it from git, then it worked. None of the other solutions worked for me.
I ended up with resetting VS Settings to make this work:
Ok, I'm not exactly sure why my Visual Studio 2019 v16.8.2 was not showing the data tips popup whenever I hover over the variables when I'm debugging. FYI, I am using a project that was created on another machine with the same version of Visual Studio. I got it fixed by doing the following steps.
Load up the project and set it to release build.
Visit Tools -> Options -> Use Managed Compatibility Code, set it to enabled. Close the Options menu.
Remove any breakpoints in your code.
Run the project in Release build mode, instead of Debug mode.
Let the program run for 5 seconds and then click red square that STOPS the debugging running program.
Open up the Options again and change the 'Use Managed Compatibility Code' back to disabled(uncheck it). Close Options.
Add some breakpoints and set the run mode back to 'Debug' mode and click Play to debug the program as per normal usage.
Doing these steps in this order solved the problem for me. I'm not exactly sure which steps solve the problem but somehow in doing the preceding list of things, it's now fixed. A reinstall of VS 2019 didn't help.
UPDATE: After going back to my project and attempting to debug, it appears it's back to not working again. I tried the above steps and that only fixes the problem for the first iteration of the loop I'm working in. It appears when the code is working, then the next iteration through the loop and when it comes to my breakpoints, they are no longer showing the little popup window that allows you to inspect the variable data. So doing the above-mentioned steps only solves the problem for the first time the breakpoints are hit.
P.S. I'm using two instances of Visual Studio 2019 and am recreating one of my older apps so that it is up to date. I'm not sure if this has anything to do with the datatip's not showing up when mouse hovers over the variables or not.
I updated the package of RestSharp, and my problem solved. Packages with warning icon on it can cause this problem.
drop this into .csproj of your project (first propertygroup).
<DebugEngines>{351668CC-8477-4fbf-BFE3-5F1006E4DB1F}</DebugEngines>
It's basically as adding for your project manually that it uses compatibility managed mode, since in vs2022 this option does not exist in options.
For me, this worked on Microsoft Visual Studio Community 2017, Version 15.9.9:
If you are facing this issue simply uninstall the current version and reinstall VS. After installing and running debugging mode first time, please choose "Disable Just My code and Continue" selection,it should work.(as shown in the attached screen shot).
If you do not want to uninstall and then re-install visual studio,then try these settings on the existing VS installation:
Go to: Options => Import and Export Settings ==>Reset All Settings==>No Just reset settings,overwrite my current settings =>Finish
after this simply start debugging and choose "Disable Just My code and Continue" option.
3.If you are still having problem,please also make sure by going to project =>properties ==> Configurations that you have configurations set to debug(sometimes configurations are set to release)
Go to Tools=>options =>Debugging ==> General ==> select Suppress JIT optimization on module load
Okay , weird things are happening to me again. This morning when i started my ASP.NET application, worked on it a bit and now when i try to publish it. I'm getting served with an error where i can't seem to find any documentation on
Error 1 Unable to apply a change while debugging. Source file '\Properties\AssemblyInfo.cs' was reloaded. You must restart the debugging session.
Anyone knows what to do with this ?
Confirm that neither this instance of visual studio nor another is debugging the binaries in question.
Restart Visual Studio. This will usually fix the problem.
If that still doesn't work, try disabling all addons and restarting visual studio one more time.
Finally, as a last resort, reinstalling visual studio has a way of fixing seemingly unfixable problems.
You can try closing the ASP.NET Development Server. It will be in the system tray (next to time), just double click it and click "Close" then just run again.
Or you can open Task Manager and end the process of Image Name: WebDev.Webserver...