-
Notifications
You must be signed in to change notification settings - Fork 1k
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
DllNotFoundException: System.Native when executing RuntimeInformation.IsOSPlatform on mono #6682
Comments
The dotnet CLI does not support producing mono-compatible outputs at this time. |
I believe I just ran across this same issue, so I wanted to double check before investigating down a different path. Does this basically mean that, at this time, there is no recourse for developing a net451 (or similar) application on OSX? If it makes any difference, I'm seeing this issue when I use If the answer is the same, what is the plan (if any) to support mono-compatible outputs? Is there an alternative? |
@jasoncavett I've worked around it by putting this into my Dockerfile for mono builds but that would probably have side-effects if you're looking to target future versions of the framework. Not sure if it works on OSX either, but could give it a go.
|
Thanks @CL0SeY. As I'm on OSX, I see that I have no *.so files in the shared libraries. Instead, I have |
@jasoncavett It would probably be something similar. Give it a go and see? :) |
Hi @CL0SeY. I think I'm going to bypass this altogether and spend time switching to use netcore. I appreciate your help. Thank you. |
@jasoncavett see dotnet/cli#3964 . You might be able to make use of the same |
I'm trying to run a basic ASP.NET Core application on Ubuntu 16.04 using mono 4.2.1 and .Net Core 1.0:
mkdir webapp
,cd webapp
,dotnet new -t web
"net451": { }
, remove prepublish from scriptsdotnet restore
,dotnet publish
mono bin/Debug/net451/ubuntu.16.04-x64/publish/webapp.exe
At the last step, I get an exception:
Since there is no System.Native in the
publish
directory, I attempt to work around this by adding"runtime.ubuntu.16.04-x64.runtime.native.System": "1.0.1"
to dependencies.This copies
System.Native.so
(andSystem.Native.a
) topublish
, but I still get the same exception. Then, by settingMONO_LOG_LEVEL="debug"
, I figure out that mono is mostly looking forlibSystem.Native
(orlibSystem.Native.so
). So I runmv System.Native.so libSystem.Native
and now the application finally executes.Trivial console application trying to reproduce the issue behaves differently.
dotnet publish
publishes a different version of System.Runtime.InteropServices.RuntimeInformation.dll: it seems it's the one from runtimes/unix/lib/netstandard1.1 from the NuGet package for the ASP.NET Core application, and the one from lib/net45 for the trivial console application. I believe this is caused by referencing the libuv package, which forces the use of runtimes.Note: I didn't use
dotnet run
at first, because that encounters a a different bug. But the workaround for that (usedotnet run -c Release
) throws the sameDllNotFoundException
as above.Originally reported as dotnet/core#205.
The text was updated successfully, but these errors were encountered: