Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

An assembly specified in the application dependencies manifest

I wrote a .net core console application on mac and it's working fine. Then I made a build for ubuntu by using

dotnet build --runtime ubuntu.16.04-x64

the result was:

MyAppName.Server                MyAppName.Server.runtimeconfig.dev.json
MyAppName.Server.deps.json      MyAppName.Server.runtimeconfig.json
MyAppName.Server.dll            libhostfxr.so
MyAppName.Server.pdb            libhostpolicy.so

I copied these files on my linux server and run the following command

dotnet MyAppName.Server.dll

And now I getting

Error:
  An assembly specified in the application dependencies manifest (MyAppName.Server.deps.json) was not found:
    package: 'Ether.Network', version: '2.0.1'
    path: 'lib/netstandard1.3/Ether.Network.dll'

Ether.Network is the only package that I using.

like image 518
Almis Avatar asked Feb 03 '18 18:02

Almis


1 Answers

From dotnet build's documentation:

If the project has third-party dependencies, such as libraries from NuGet, they're resolved from the NuGet cache and aren't available with the project's built output. With that in mind, the product of dotnet build isn't ready to be transferred to another machine to run.

You want dotnet publish instead:

The dotnet publish command's output is ready for deployment to a hosting system (for example, a server, PC, Mac, laptop) for execution and is the only officially supported way to prepare the application for deployment.

like image 137
milleniumbug Avatar answered Oct 11 '22 10:10

milleniumbug