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

Native library not copied to output directory #115

Closed
TillAlex opened this issue Sep 12, 2019 · 6 comments
Closed

Native library not copied to output directory #115

TillAlex opened this issue Sep 12, 2019 · 6 comments

Comments

@TillAlex
Copy link
Contributor

I am referencing the libLLVM 8.0 nuget package from a .NET standard 2.0 which is referenced by a .NET Core 2.0 as well as a .NET Framework 4.7.1 project. In both cases the libLLVM is not copied to the output folder.

Even if I reference the libLLVM.runtime.win-x64 Nuget package directly libLLVM.dll is not copied. Currently the only way to make it work is referencing libLLVM.dll from the nuget folder and set "Copy if newer".

Is there anything I am missing? Is the libLLVM 8.0 Nuget package supposed to copy the correct runtime library automatically?

@mjsabby
Copy link
Contributor

mjsabby commented Sep 14, 2019

I think the way nuget works is you may have to publish to the specific RID. Can you try dotnet publish -c Release -r win-x64 and see if it gets placed here?

@TillAlex
Copy link
Contributor Author

Thanks for the hint. Using an explictit runtime identifier the native library gets placed. To make it work in Visual Studio I had to add

<RuntimeIdentifier>win-x64</RuntimeIdentifier>

to the project file.

@tannergooding
Copy link
Member

I would recommend <RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">$(NETCoreSdkRuntimeIdentifier)</RuntimeIdentifier>.

The above will use the given RID if one is specified (which allows cross-compiling, for example) and otherwise defaults to the RID of the .NET SDK that the build is actively being driven by (which should ensure you get something that works for the current machine).

@TillAlex
Copy link
Contributor Author

@tannergooding Would be great to automatically use the correct RuntimeIdentifier. Unfortunately your idea does not work on my machine. Seems that NETCoreSdkRuntimeIdentifier is not set here. Any idea what I am doing wrong?

@tannergooding
Copy link
Member

Are you building with msbuild rather than dotnet build or dotnet msbuild?

@TillAlex
Copy link
Contributor Author

It does not work no matter if I am using dotnet build or Visual Studio 2019.

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

3 participants