Sdk: dotnet build does not publish native dependencies for net451 on Mac and Linux

Created on 19 Apr 2016  路  5Comments  路  Source: dotnet/sdk

Steps to reproduce

Run build.sh from https://github.com/aspnet/KestrelHttpServer on Mac and/or linux.

You can also reproduce by running KestrelHttpServer/samples/SampleApp using dotnet run -f net451.

Expected behavior

All the tests should pass. The sample app should run successfully.

Actual behavior

You will see the Microsoft.AspNetCore.Server.Kestrel.FunctionalTests project fail on net451/mono due to test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/System.DllNotFoundException : libuv. This is caused by a lack of libuv.so in bin/Debug/net451/[rid]/.

The Kestrel SampleApp exits immediately with

System.AggregateException: One or more errors occurred. ---> System.DllNotFoundException: libuv
  at (wrapper managed-to-native) Microsoft.AspNetCore.Server.Kestrel.Networking.Libuv/NativeMethods:uv_loop_size ()
  at Microsoft.AspNetCore.Server.Kestrel.Networking.Libuv.loop_size () [0x00000] in <filename unknown>:0
  at Microsoft.AspNetCore.Server.Kestrel.Networking.UvLoopHandle.Init (Microsoft.AspNetCore.Server.Kestrel.Networking.Libuv uv) [0x00000] in <filename unknown>:0
  at Microsoft.AspNetCore.Server.Kestrel.KestrelThread.ThreadStart (System.Object parameter) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Threading.Tasks.Task.ThrowIfExceptional (Boolean includeTaskCanceledExceptions) [0x00000] in <filename unknown>:0
  at System.Threading.Tasks.Task.Wait (Int32 millisecondsTimeout, CancellationToken cancellationToken) [0x00000] in <filename unknown>:0
  at System.Threading.Tasks.Task.Wait () [0x00000] in <filename unknown>:0
  at Microsoft.AspNetCore.Server.Kestrel.KestrelEngine.Start (Int32 count) [0x00000] in <filename unknown>:0
  at Microsoft.AspNetCore.Server.Kestrel.KestrelServer.Start[Context] (IHttpApplication`1 application) [0x00000] in <filename unknown>:0
---> (Inner Exception #0) System.DllNotFoundException: libuv
  at (wrapper managed-to-native) Microsoft.AspNetCore.Server.Kestrel.Networking.Libuv/NativeMethods:uv_loop_size ()
  at Microsoft.AspNetCore.Server.Kestrel.Networking.Libuv.loop_size () [0x00000] in <filename unknown>:0
  at Microsoft.AspNetCore.Server.Kestrel.Networking.UvLoopHandle.Init (Microsoft.AspNetCore.Server.Kestrel.Networking.Libuv uv) [0x00000] in <filename unknown>:0
  at Microsoft.AspNetCore.Server.Kestrel.KestrelThread.ThreadStart (System.Object parameter) [0x00000] in <filename unknown>:0 <---
dbug: Microsoft.AspNetCore.Hosting.Internal.WebHost[5]
      Hosting shutdown
[ERROR] FATAL UNHANDLED EXCEPTION: System.AggregateException: One or more errors occurred. ---> System.DllNotFoundException: libuv
  at (wrapper managed-to-native) Microsoft.AspNetCore.Server.Kestrel.Networking.Libuv/NativeMethods:uv_loop_size ()
  at Microsoft.AspNetCore.Server.Kestrel.Networking.Libuv.loop_size () [0x00000] in <filename unknown>:0
  at Microsoft.AspNetCore.Server.Kestrel.Networking.UvLoopHandle.Init (Microsoft.AspNetCore.Server.Kestrel.Networking.Libuv uv) [0x00000] in <filename unknown>:0
  at Microsoft.AspNetCore.Server.Kestrel.KestrelThread.ThreadStart (System.Object parameter) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Threading.Tasks.Task.ThrowIfExceptional (Boolean includeTaskCanceledExceptions) [0x00000] in <filename unknown>:0
  at System.Threading.Tasks.Task.Wait (Int32 millisecondsTimeout, CancellationToken cancellationToken) [0x00000] in <filename unknown>:0
  at System.Threading.Tasks.Task.Wait () [0x00000] in <filename unknown>:0
  at Microsoft.AspNetCore.Server.Kestrel.KestrelEngine.Start (Int32 count) [0x00000] in <filename unknown>:0
  at Microsoft.AspNetCore.Server.Kestrel.KestrelServer.Start[Context] (IHttpApplication`1 application) [0x00000] in <filename unknown>:0
---> (Inner Exception #0) System.DllNotFoundException: libuv
  at (wrapper managed-to-native) Microsoft.AspNetCore.Server.Kestrel.Networking.Libuv/NativeMethods:uv_loop_size ()
  at Microsoft.AspNetCore.Server.Kestrel.Networking.Libuv.loop_size () [0x00000] in <filename unknown>:0
  at Microsoft.AspNetCore.Server.Kestrel.Networking.UvLoopHandle.Init (Microsoft.AspNetCore.Server.Kestrel.Networking.Libuv uv) [0x00000] in <filename unknown>:0
  at Microsoft.AspNetCore.Server.Kestrel.KestrelThread.ThreadStart (System.Object parameter) [0x00000] in <filename unknown>:0 <---

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-rc2-002416)

Product Information:
 Version:     1.0.0-rc2-002416
 Commit Sha:  37f00f24e9

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  14.04
 OS Platform: Linux
 RID:         ubuntu.14.04-x64

@davidfowl @pakrym

Most helpful comment

@piotrpMSFT: is this for real? How has this not been communicated clearly to the community? Dropping support for net451 on osx/mono is a HUGE deal for many of us. Is there a workaround or something using imports?

All 5 comments

This is causing our Travis runs to fail:

https://travis-ci.org/aspnet/KestrelHttpServer/jobs/124003631

net45* projects are not supported on non-Windows OS's for 1.0.0.

@richlander FYI

@piotrpMSFT: is this for real? How has this not been communicated clearly to the community? Dropping support for net451 on osx/mono is a HUGE deal for many of us. Is there a workaround or something using imports?

Pretty sure this works

Based on @davidfowl cli-samples/HelloMvc

{
  "buildOptions": {
    "preserveCompilationContext": true,
    "emitEntryPoint": true,
    "debugType": "portable"
  },
  "publishOptions": {
    "include": [
      "wwwroot",
      "Views"
    ]
  },
  "dependencies": {
    "Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-final",
    "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",    
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final",
    "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-final"   
  },
  "frameworks": {
    "net451": {      
    }    
  },
  "scripts": {
    "postpublish": "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%"
  }
}

Mono information:

Mono JIT compiler version 4.2.3 (explicit/832de4b Thu Mar  3 19:24:57 EST 2016)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           normal
    SIGSEGV:       altstack
    Notification:  kqueue
    Architecture:  x86
    Disabled:      none
    Misc:          softdebug
    LLVM:          yes(3.6.0svn-mono-(detached/a173357)
    GC:            sgen

Stacktrace:

Unhandled Exception:
System.AggregateException: One or more errors occurred. ---> System.DllNotFoundException: libuv
at (wrapper managed-to-native) Microsoft.AspNetCore.Server.Kestrel.Networking.Libuv+NativeMethods:uv_loop_size ()
at Microsoft.AspNetCore.Server.Kestrel.Networking.Libuv.loop_size () <0x30f8f98 + 0x00014> in <filename unknown>:0
at Microsoft.AspNetCore.Server.Kestrel.Networking.UvLoopHandle.Init (Microsoft.AspNetCore.Server.Kestrel.Networking.Libuv uv) <0x30f8f08 + 0x0002b> in <filename unknown>:0
at Microsoft.AspNetCore.Server.Kestrel.KestrelThread.ThreadStart (System.Object parameter) <0x30f8338 + 0x00083> in <filename unknown>:0
--- End of inner exception stack trace ---

Edit: Starting to think this might be an issue with my mono version or such.
Edit2: Fixed my mono version to Stable 4.2.3.4/832de4b and now Kestrel starts, ah well, Razor views does not compile though, but that麓s not this issue so.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gkhanna79 picture gkhanna79  路  3Comments

billwert picture billwert  路  3Comments

moozzyk picture moozzyk  路  3Comments

krwq picture krwq  路  3Comments

noelitoa picture noelitoa  路  3Comments