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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With