I have some problem with deploy simple .Net core console application to linux server.
I've created simple console Hello world application this way:
dotnet new console -o hello
Then I tested this application on my devlop computer
dotnet run
It works fine.
Next I created release to debian platform this way
dotnet publish -c release -r debian.8-x64 --self-contained
Now I have a folder with distribution
C:\Projects\C#\hello\bin\MCD\release\netcoreapp2.0\debian.8-x64
Further I took folder debian.8-x64 and copied to my linux computer with Debias 8 OS
Found file for execution (~/debian.8-x64/hello
) and changed it mode
chmod +x ./hello
Now I'm trying to execute file
./hello
And got an exception
root@my2ndbox:/home/alex/temp/debian.8-x64# ./hello
Error:
An assembly specified in the application dependencies manifest (hello.deps.json) was not found:
package: 'runtime.linux-x64.Microsoft.NETCore.App', version: '2.0.0'
path: 'runtimes/linux-x64/lib/netcoreapp2.0/Microsoft.CSharp.dll'
Net framework is installed on Linux machime with the same version as on my develop computer
root@my2ndbox:/home/alex/temp/debian.8-x64# dotnet --version
2.0.2
What may cause this type of error?
/hello
dir – Vasek