-
Notifications
You must be signed in to change notification settings - Fork 715
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Microsoft.Diagnostics.Tracing.TraceEvent - Missing Dependency Microsoft.Win32.Registry #755
Comments
Relatively same, so for now I am not opening new issue. I am getting following exception randomly when I call session.EnableProvider("...") |
I can't reproduce this issue. Ideally you include a trivial VS solution that demonstrates the problem. Note that TraceEvent has support for both NetStandard and .NET 4.5. You say that this is running on .NET 4.6.1. My guess is that what is happening is that your solution is asking for the NetStandard flavor of Microsoft.Diagnostics.Tracing.TraceEvent.dll (which has a reference to Microsoft.Win32.Registry.dll (if you had built against the V4.5 version it would 'know' that the registry functions are in mscorlib)), and the NetStandard 'forwarding' DLLs are not operating correctly. If so, this is likely not an issue with TraceEvent but NetStandard support. You can work around it by targeting .NET 4.5. But that is just a guess. having an actual repro solution so I get exactly what is needed to reproduce the problem will help make progress. I SUSPECT that what is going on is that you |
Hi Vance, Here is a sample when using WPF targeting .NET Framework 4.7.2 |
Hi Vance here stack of exception with fusion log detail from an winform application targeting 4.7.2 Exception: Could not load file or assembly 'Microsoft.Win32.Registry, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Stack Trace: |
Sorry for the delay, you gave me this repro quite a while ago. I at least have a work-around for you If you right click on your 'References' item in the Solution Explorer and select 'Manage Nuget Packages' and add a reference to the Microsoft.Win32.Registry nuget package (V 4.5 is fine), then it will add a Microsoft.Win32.Registry.dll to your bin\ directory and it should work (It did for me). I understand the problem a bit better now, but still need to figure out the best solution. |
A fix for this is now on nuget.org as release https://github.com/Microsoft/perfview/releases/tag/T2.0.31 Thanks for helping getting this fixed. |
I still see this error when running from a UWP project. The main issue I have is that the app fails with ACCESS_DENIED when running as UWP as there is no way to run as elevated. |
@ConstantinDulu, I suspect that you are trying to create and start a TraceEventSession. Unfortunately, this isn't possible via a UWP app as far as I'm aware. This is because control of ETW requires elevation and I'm not aware of any way to elevate within a UWP app. |
When calling dispose on TraceEventSession it throws an exception because it's unable to load this assembly. This is using a .Net 4.6.1 app.
To resolve have to add this NuGet package to the project. It should be listed included as dependency so it's automatically added when needed.
This started with version 2.0.25
The text was updated successfully, but these errors were encountered: