Skip to content
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

Fix dev-time load failure loading KernelTraceControl. #745

Merged
merged 1 commit into from
Sep 13, 2018

Conversation

vancem
Copy link
Contributor

@vancem vancem commented Sep 13, 2018

OSExtentions needs to be 'next' to the architecture directories where KernelTraceControl.dll lives for it to load
them properly. This works for published .NET Core apps, but by default 'dotnet run' runs nuget DLLs out of
the nuget cache (it does not copy them to the app directory). This breaks the loading of KernelTraceControl.dll.

We already manually copy the native files and some interop files to the output directory in the TraceEvent nuget
package. Here we simply add OSExtentions.dll to that list so it is loaded from the same place even in the dev-time
scenario.

OSExtentions needs to be 'next' to the architecture directories where KernelTraceControl.dll lives for it to load
them properly.   This works for published .NET Core apps, but by default 'dotnet run' runs nuget DLLs out of
the nuget cache (it does not copy them to the app directory).   This breaks the loading of KernelTraceControl.dll.

We already manually copy the native files and some interop files to the output directory in the TraceEvent nuget
package.   Here we simply add OSExtentions.dll to that list so it is loaded from the same place even in the dev-time
scenario.
@vancem
Copy link
Contributor Author

vancem commented Sep 13, 2018

@adamsitnik - this is my counter-proposal for fixing the issue you ran into. Basically it is you option 2 (fighting with nuget to get the DLL in the right place). It just so happens, we had done this fighting in the past, so it was pretty easy to add this. It is also the least hacky way to solve the problem (TraceEvent code should not know about Nuget packaging conventions).

@vancem
Copy link
Contributor Author

vancem commented Sep 13, 2018

@adamsitnik you can try this out yourself, but I was able to reproduce your failure, and this fixed it.

@vancem vancem merged commit 7806ecc into microsoft:master Sep 13, 2018
@adamsitnik
Copy link
Member

@vancem thanks a lot! I have verified it and the fix solves the problem.

And I have learned new NuGet trick from this PR ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants