5

I'm facing an issue where I'm unable to use the diagnostic tool(s) during remote debugging. If I start my program on my local machine, everything is fine.

After making sure that my domain user has debug permission on the target machine (configured in the remote debugging tool) I attached my Visual Studio to the running process on the remote machine. Then I switched over to the diagnostics window only to be greeted by an error message

enter image description here.

After searching the web I found a way to get a detailed output and got this:

Debug --- Diagnostics Hub Components Loader --- Component 44d04ed9-f786-458c-93a9-7207a3cc52e1 (Microsoft.DiagnosticsHub.Components.LazyCollectorFactory) has been loaded.
Debug --- Diagnostics Hub Components Loader --- Component 28b3f966-03cc-4632-ae04-0861ef17555a (Microsoft.DiagnosticsHub.Components.LazyCollectorFactory) has been loaded.
Debug --- Diagnostics Hub Components Loader --- Component 113e964e-152f-45e7-b70e-1e5482802d0c (Microsoft.DiagnosticsHub.Diagnostics.OutputWindowLogger) has been loaded.
Debug --- Diagnostics Hub Components Loader --- Component 72089e7a-a3c8-4652-9817-f33c8149affc (Microsoft.DiagnosticsHub.Components.LazyCollectorFactory) has been loaded.
Debug --- Diagnostics Hub Components Loader --- Component 42d07b97-c049-403e-bd24-6c55fb096d1a (Microsoft.DiagnosticsHub.VisualStudio.Targets.ExecutableTargetProviderFactory) has been loaded.
Debug --- Diagnostics Hub Components Loader --- Component 34c0b0b0-0658-4dd3-a677-81108d433d8d (Microsoft.DiagnosticsHub.VisualStudio.Targets.ProcessTargetProviderFactory) has been loaded.
Debug --- Diagnostics Hub Components Loader --- Component 52827652-539a-4099-b829-38cba3641110 (Microsoft.DiagnosticsHub.VisualStudio.Targets.AspNetWebsiteTargetProviderFactory) has been loaded.
Debug --- Diagnostics Hub Components Loader --- Component 283ff32f-bc50-467c-a318-ee7015338ac0 (Microsoft.DiagnosticsHub.VisualStudio.Targets.VisualStudioProjectTargetProviderFactory) has been loaded.
Debug --- Diagnostics Hub Components Loader --- Component 572daee0-945b-41d7-8d79-5cbf5a114372 (Microsoft.DiagnosticsHub.Components.LazyToolFactory) has been loaded.
Debug --- Diagnostics Hub Components Loader --- Component 7f65b00f-b8e3-494d-a7b7-51f13cc2011a (Microsoft.DiagnosticsHub.Components.LazyToolFactory) has been loaded.
Debug --- Diagnostics Hub Components Loader --- Component 962a0ef2-9fae-4c82-98b4-b1406b977de3 (Microsoft.DiagnosticsHub.Components.LazyToolFactory) has been loaded.
Debug --- Diagnostics Hub Components Loader --- Component 33041a6b-f1dc-4894-86a9-14e3af8299c2 (Microsoft.DiagnosticsHub.Components.LazyToolFactory) has been loaded.
Debug --- Diagnostics Hub Components Loader --- Component 1160defd-0dd3-4a25-a57b-aeff03e17354 (Microsoft.DiagnosticsHub.Components.LazyToolFactory) has been loaded.
Debug --- Diagnostics Hub Components Loader --- Component 013914d7-d262-4da2-8fa4-ba8b4e328a1e (Microsoft.DiagnosticsHub.Components.LazyToolFactory) has been loaded.
Debug --- Diagnostics Hub Components Loader --- Component dbd5eb76-7ff8-4e5a-a9b8-21b007462c7f (Microsoft.DiagnosticsHub.Components.LazyToolFactory) has been loaded.
Debug --- Diagnostics Hub Components Loader --- Component 92d8d397-d96b-442e-b891-229b833e8797 (Microsoft.DiagnosticsHub.Components.LazyToolFactory) has been loaded.
Debug --- Diagnostics Hub Components Loader --- Component 051c002f-2430-4d7a-a545-28294e888186 (Microsoft.DiagnosticsHub.Components.LazyToolFactory) has been loaded.
Debug --- Diagnostics Hub Components Loader --- Component 96dcf139-9a62-4adf-b9fa-7aec44c0b9cc (Microsoft.DiagnosticsHub.Components.LazyToolFactory) has been loaded.
Debug --- Diagnostics Hub Components Loader --- Component 96f1f3e8-f762-4cd2-8ed9-68ec25c2c722 (Microsoft.DiagnosticsHub.Components.LazyToolFactory) has been loaded.
Debug --- Diagnostics Hub Components Loader --- Plug-ins have been loaded.
Debug --- Service Microsoft.DiagnosticsHub.IDocumentsService implementation --- New document was created 'C:\Users\steffen\AppData\Local\Temp\Bericht20150909-1642.diagsession'
Debug --- ApplicationPathService --- Hub application path is 'E:\Programme\Visual Studio\Common7\IDE\CommonExtensions\Platform\DiagnosticsHub'
Debug --- Scripted Control (PerformanceDebuggerSwimLanesView.manifest.json) --- Initializing the ScriptedControl with manifest file 'E:\Programme\Visual Studio\Common7\IDE\CommonExtensions\Platform\DiagnosticsHub\WebViews\PerformanceDebuggerSwimLanesView.manifest.json'. Base directory 'E:\Programme\Visual Studio\Common7\IDE\CommonExtensions'
Debug --- Scripted Control (PerformanceDebuggerSwimLanesView.manifest.json) --- Menu command service is provided for manifest 'E:\Programme\Visual Studio\Common7\IDE\CommonExtensions\Platform\DiagnosticsHub\WebViews\PerformanceDebuggerSwimLanesView.manifest.json'.
Debug --- Scripted Control (PerformanceDebuggerSwimLanesView.manifest.json) --- Creating UIElement for E:\Programme\Visual Studio\Common7\IDE\CommonExtensions\Platform\DiagnosticsHub\WebViews\PerformanceDebuggerSwimLanesView.manifest.json.
Debug --- EventAggregator --- Event Aggregator doesn't have registered managed handlers for event type 'DiagnosticsHub.EventAggregator.DetailsViewSelectionChangedEvent'
Debug --- DiagnosticsHubPackage --- Visual Studio asks service 'Microsoft.DiagnosticsHub.VisualStudio.SDK.SVsDiagnosticsHubService'
Debug --- DiagnosticsHubPackage --- Creating service 'Microsoft.DiagnosticsHub.VisualStudio.SDK.SVsDiagnosticsHubService'.
Debug --- Session ('02e7a183-8bf4-420d-8101-d6850e19f723') --- Changing state from 'Unknown' to 'Created'.
Debug --- Document ('C:\Users\steffen\AppData\Local\Temp\Bericht20150909-1642.diagsession') --- Changing document state from 'New' to ActiveSession.
Debug --- Session ('02e7a183-8bf4-420d-8101-d6850e19f723') --- State has been changed to 'Created'.
Debug --- SessionsService --- New session has been created for document 'C:\Users\steffen\AppData\Local\Temp\Bericht20150909-1642.diagsession'
Debug --- SessionTargetsService --- New target added PerfDebuggerTarget.
Debug --- Session ('02e7a183-8bf4-420d-8101-d6850e19f723') --- Changing state from 'Created' to 'InitializePerformanceDebugger'.
Debug --- Session ('02e7a183-8bf4-420d-8101-d6850e19f723') --- State has been changed to 'InitializePerformanceDebugger'.
Debug --- Session ('02e7a183-8bf4-420d-8101-d6850e19f723') --- Collectors count: 1.
Debug --- Session ('02e7a183-8bf4-420d-8101-d6850e19f723') --- Changing state from 'InitializePerformanceDebugger' to 'PerformanceDebuggerInitialized'.
Debug --- Session ('02e7a183-8bf4-420d-8101-d6850e19f723') --- State has been changed to 'PerformanceDebuggerInitialized'.
Das System kann die angegebene Datei nicht finden. (Ausnahme von HRESULT: 0x80070002)
Debug --- Session ('02e7a183-8bf4-420d-8101-d6850e19f723') --- Changing state from 'PerformanceDebuggerInitialized' to 'CollectionTerminating'.
Debug --- Session ('02e7a183-8bf4-420d-8101-d6850e19f723') --- State has been changed to 'CollectionTerminating'.
Debug --- Session ('02e7a183-8bf4-420d-8101-d6850e19f723') --- Changing state from 'CollectionTerminating' to 'CollectionTerminated'.
Error --- Session ('02e7a183-8bf4-420d-8101-d6850e19f723') --- 

Stacktrace:

System.Exception: Error code: 0x80070002
       bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       bei Microsoft.DiagnosticsHub.VisualStudio.Collectors.CollectorService.StandardClientCollector.<CleanUpCollectionSession>d__29.MoveNext()
    --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
       bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       bei Microsoft.DiagnosticsHub.VisualStudio.Collectors.CollectorService.StandardClientCollector.<Failed>d__17.MoveNext()
    --- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
       bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       bei Microsoft.DiagnosticsHub.VisualStudio.Runtime.PerformanceDebuggerSession.<TerminateCollectionAsync>d__38.MoveNext()
    Debug --- Document ('C:\Users\steffen\AppData\Local\Temp\Bericht20150909-1642.diagsession') --- Changing document state from 'ActiveSession' to Failed.
    Debug --- SessionsService --- Closing session for document C:\Users\steffen\AppData\Local\Temp\Bericht20150909-1642.diagsession
    Debug --- SessionsService --- Session for document C:\Users\steffen\AppData\Local\Temp\Bericht20150909-1642.diagsession was closed

The error mentions a file that can not be found (Das System kann die angegebene Datei nicht finden. (Ausnahme von HRESULT: 0x80070002)) but it doesn't mention which file is not found.

I couldn't find anything helpful on SO or the web. The closest thing I found is this, but nothing crashed here, I just got the exception in the output/diaghub window and that's it.

edit

Thank's to Thomas I was able to find 4 missing files and one that I'm unsure about.

  • First two files are two .cs files from my projects. It's trying to find those two files on my machine but with the path from the buildserver. Not sure what's going on there, but I doubt that that's the problem
  • Applicationinsights.config - should be located inside the .csproj folder of my startup project but it's reported as 'Name not found' can be ignored. It belongs to an Azure based service
  • Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler.dll - should be inside Common7\IDE\CommonExtensions\Microsoft\Roslyn\ExpressionEvaluators but is reported as 'Name not found' copying it didn't fix the problem
  • and the one I'm unsure about: C:\Windows\SysWOW64\api-ms-win-core-fibers-l1-1-1.DLL. First time the filename is [...]fibers-l1-2-1.dll, second time it's [...]fibers-l1-1-1.dll. Didn't appear on my 3rd and 4th run
  • Another file appeared on my 1st, 3rd and 4th run (ignored it before because it didn't appear in the 2nd run): MSCORDBI_MACX86, should be in C:\Users\steffen\AppData\Local\Microsoft\SilverlightDebuggingConfig1.0\mscordbi_macx86.dll
Steffen Winkler
  • 2,805
  • 2
  • 35
  • 58
  • 1
    For missing files, can you try http://debugging.wellisolutions.de/procmonanalyzer/? – Thomas Weller Sep 10 '15 at 13:24
  • hmm, that gives me a rather long list of files not found. I guess most are found after some probing around. I tried some tricks like attaching 4 times, restart Visual Studio, attach 6 times and analyze both logs, filter for the amount of attachments and search for common entries. I did not find any file that was present in each log. – Steffen Winkler Sep 11 '15 at 09:35
  • The list should be sorted by the amount of probing needed. Typically the one that's not found needs most probing before. Sorry it didn't help. – Thomas Weller Sep 11 '15 at 09:42
  • hmm, seems I made a mistake before. Maybe I miscounted. I did the same thing again (couldn't belief it myself) and found multiple common entries. The one that's sticking out most is `Expression Evaluators\Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler.dll`, editing my question. – Steffen Winkler Sep 11 '15 at 09:45
  • @Thomas not Search Everything but Windows search found it in `\Visual Studio\Common7\IDE\PrivateAssemblies`. – Steffen Winkler Sep 11 '15 at 10:01
  • Ok, and if you put it into the folder where it is expected? – Thomas Weller Sep 11 '15 at 10:02
  • doesn't work. But the assembly I was unsure about didn't appear either, so that can be ruled out. Still remaining: Applicationinsights, my two .cs files and I got a new file: MSCORDBI_MACX86 which I also got on my first run but not my second. – Steffen Winkler Sep 11 '15 at 10:07
  • @Thomas well, I couldn't find the MSCORDBI_MACX86 file anywhere on my computer. Going to talk to a colleague, maybe he has it. – Steffen Winkler Sep 11 '15 at 10:13
  • Hmm, this seems to become more complex... Do you debug a silverlight application on a MAC? These are two topics I'm totally unfamiliar with – Thomas Weller Sep 11 '15 at 10:53
  • @Thomas nope. Neither Silverlight nor Mac. But I guess that Visual Studio just blindly checks for that assembly, regardless of the debug target. – Steffen Winkler Sep 11 '15 at 11:16
  • Did you solved this issue? – Kerem Demirer May 23 '16 at 15:27
  • @KeremDemirer no, never figured it out – Steffen Winkler May 23 '16 at 15:34

0 Answers0