3
votes

I wrote a test project using .NET Core and assembled the self-contained deployment for Ubuntu 16.04 as described here (see Self-contained deployment without third-party dependencies).

But when I run the app I get the following error:

An assembly specified in the application dependencies manifest (Test.deps.json) was not found:

package: 'runtime.linux-x64.Microsoft.NETCore.App', version: '2.0.0-preview2-25407-01'

path: 'runtimes/linux-x64/lib/netcoreapp2.0/Microsoft.CSharp.dll'

I am using .NET Core 2.0 Preview 2, VS2017 Preview.

I will be grateful for any help!

1

1 Answers

0
votes

This is an old question, but I just ran across this when I was trying to run a .Net Core application on Linux and wanted to share the solution. If you are getting the error above, you are likely trying to execute the wrong binary. For those following along from scratch, follow these steps:

  • On Windows, open a command prompt in the directory of the project you want to run on Linux.
  • Build the project for Linux using dotnet publish -r linux-x64
    • I chose to target linux-x64, but you can target a specific runtime if you'd like. Runtime identifiers can be found here.
  • Copy the published files to the Linux workstation. Because the above command omitted the configuration flag -c, the configuration defaulted to debug. The published files will be in Debug\netcoreapp2.0\linux-x64\publish
    • Note: there will be binaries in Debug\netcoreapp2.0\linux-x64\ too. These are not the binaries you want to copy to your Linux workstation. If you run these binaries, you will get the error described in the OP. Copy all the files in the publish directory instead. Ignore whatever files might be in linux-x64.
  • On the Linux workstation, give execute permission to the binary file. My project was named ConsoleUI, so I used chmod 764 ConsoleUI
  • Execute the binary using ./ConsoleUI

Keep in mind that you will need to at least have the .Net Core runtime installed on your Linux workstation.