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

OSExtensions.dll fails load native libraries when application is built with dotnet build #518

Closed
nategraf opened this issue Jan 13, 2018 · 1 comment

Comments

@nategraf
Copy link

If an application references TraceEvent and builds using dotnet build the functions which load one of the native libraries packaged with TraceEvent will fail when trying to find the dll. This does not occur when the app is published as a self-contained app (i.e. with dotnet publish)

The cause of this is that OSExtensions.dll looks for the native library in the x86\ or x64\ directory relative to itself, but when the package is still in the NuGet cache directory (as is the case for running apps build as shared runtime with dotnet build) the library is actually at ..\native\x86\ or ..\native\x64\ relative to the OSExtensions.dll. After being published, the native libraries are where OSExtensions.dll expects to find them.

One potential fix to this issue it to have OSExtensions.dll search in both possible locations. Another is to repackage the application to include two copies of the native libraries; one copy in net461 and one in netstandard1.6. This solutio seems wasteful though

Related issue: microsoft/xunit-performance#255

@vancem
Copy link
Contributor

vancem commented Feb 1, 2018

This should be fixed in the latest version 2.0.3 on nuget.org.

@vancem vancem closed this as completed Feb 1, 2018
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

No branches or pull requests

2 participants