{"action":"reopened","issue":{"url":"https://api.github.com/repos/dotnet/core/issues/205","repository_url":"https://api.github.com/repos/dotnet/core","labels_url":"https://api.github.com/repos/dotnet/core/issues/205/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/core/issues/205/comments","events_url":"https://api.github.com/repos/dotnet/core/issues/205/events","html_url":"https://github.com/dotnet/core/issues/205","id":164036636,"number":205,"title":"DllNotFoundException: System.Native when executing RuntimeInformation.IsOSPlatform on mono","user":{"login":"svick","id":287848,"avatar_url":"https://avatars.githubusercontent.com/u/287848?v=3","gravatar_id":"","url":"https://api.github.com/users/svick","html_url":"https://github.com/svick","followers_url":"https://api.github.com/users/svick/followers","following_url":"https://api.github.com/users/svick/following{/other_user}","gists_url":"https://api.github.com/users/svick/gists{/gist_id}","starred_url":"https://api.github.com/users/svick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svick/subscriptions","organizations_url":"https://api.github.com/users/svick/orgs","repos_url":"https://api.github.com/users/svick/repos","events_url":"https://api.github.com/users/svick/events{/privacy}","received_events_url":"https://api.github.com/users/svick/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-06T09:38:20Z","updated_at":"2016-07-26T04:27:16Z","closed_at":null,"body":"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:\r\n\r\n1. `mkdir webapp`, `cd webapp`, `dotnet new -t web`\r\n2. in project.json, remove Microsoft.NETCore.App from dependencies, change frameworks to: `\"net451\": { }`, remove prepublish from scripts\r\n3. `dotnet restore`, `dotnet publish`\r\n4. `mono bin/Debug/net451/ubuntu.16.04-x64/publish/webapp.exe`\r\n\r\nAt the last step, I get an exception:\r\n\r\n```\r\nUnhandled Exception:\r\nSystem.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: System.Native\r\n  at (wrapper managed-to-native) Interop+Sys:GetUnixNamePrivate ()\r\n  at Interop+Sys.GetUnixName () <0x40d02200 + 0x0000b> in <filename unknown>:0 \r\n  at System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform (OSPlatform osPlatform) <0x40d02190 + 0x00023> in <filename unknown>:0 \r\n  at Microsoft.Extensions.Logging.Console.ConsoleLogger..ctor (System.String name, System.Func`3 filter, Boolean includeScopes) <0x40d01bb0 + 0x00153> in <filename unknown>:0 \r\n[snip]\r\n```\r\n\r\nSince 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.\r\n\r\nThis copies `System.Native.so` (and `System.Native.a`) to `publish`, but I still get the same exception. Then, by setting `MONO_LOG_LEVEL=\"debug\"`, I figure out that mono is mostly looking for `libSystem.Native` (or `libSystem.Native.so`). So I run `mv System.Native.so libSystem.Native` and now the application finally executes.\r\n\r\n[Trivial console application trying to reproduce the issue](https://gist.github.com/svick/18a06d31d680a9f4e7e9d770037096af) 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.\r\n\r\nI'm not sure if this is an issue with corefx or `dotnet publish`, so I'm reporting it here."}}
{"actor":{"display_login":"blackdwarf"}}