0

It is very simalar to Cannot start Concurrency Visualizer in Visual Studio 2012. Got error "Unable to start the ETW collection" but the error differents. If I start Concurrency Visualizer from VS2019 it showes the error "Unable to start the ETW collection", but if I run it from command line CVCollectionCmd.exe /Launch exe_path the error is

A fatal error happened while running the application: Failed to start the "NT Kernel Session" and stack trace

Exception 'System.ServiceModel.FaultException`1[Microsoft.ConcurrencyVisualizer.Common.CollectionFault]', trace:
Server stack trace:
   в System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   в System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   в System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   в System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
   в System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   в System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   в Microsoft.ConcurrencyVisualizer.Common.ICollectionService.StartTracing(TraceProviders providers, String tracingDir, String traceFileNamePrefix, EtwBufferSettings kernelBufferSettings, EtwBufferSettings userBufferSettings)
   в Microsoft.ConcurrencyVisualizer.CommandLine.CollectionServiceManager.StartCollectionForTarget(LocalConfig config, TargetBase target)
   в Microsoft.ConcurrencyVisualizer.CommandLine.LaunchCommand.Execute(CollectionCmdReader reader)
   в Microsoft.ConcurrencyVisualizer.CommandLine.CollectionCmdApp.Main(String[] args)

If I start CVCollectionCmd.exe /Query it reportes Not collecting, ready to start.

Alexey Subbota
  • 938
  • 6
  • 23
  • Hi, what's your current project type? I tried to install this extension inside VS 2019 and open a new C# console project to start Concurrency Visualizer and it works fine. Please help to check if this issue happens to all your projects or not. You can also try to perform a clean boot: https://support.microsoft.com/en-us/topic/how-to-perform-a-clean-boot-in-windows-da2f9573-6eec-00ad-2f8a-a97a1807f3dd#:~:text=%20How%20to%20perform%20a%20clean%20boot%20,select%20System%20Configuration%20from%20the%20results.%20See%20More. to see if other apps affect it or not. – Sara Liu - MSFT Jan 10 '23 at 06:56
  • @SaraLiu-MSFT, I use C++ project, but it doesn't matter, because it has to be able to attach to any process without any project. And it did work some times ago. Clean boot is too dangerous to try. – Alexey Subbota Jan 10 '23 at 18:19
  • Hi Alexey, thanks for your detailed information. Would you please help to check if you create a new C++ project, start Concurrency Visualizer and this issue persists or not? Have you tried to re-install this extension before? If not, please go to the Extensions-Manage Extensions-Installed to remove 'Concurrency Visualizer for Visual Studio 2019', then re-install it to test. – Sara Liu - MSFT Jan 12 '23 at 02:33

1 Answers1

0

This problem could be similar to PerfView issue https://github.com/microsoft/perfview/issues/1723. Try disabling defender real-time protection.