0

I am deploying a .NET Core console app as a standalone build to multiple platforms. I am having trouble getting the macOS version to run. When I run the executable, I get the following error:

"Error: assembly specified in the dependencies manifest was not found -- package: 'runtime.osx.10.10-x64.runtime.native.System', version: '4.3.0', path: 'runtimes/osx.10.10-x64/native/System.Native.a'"

I have built and deployed the app to win7-x86, win7-x64, win10-x86, win10-x64, centos.7-x64, all without any problems.

I am attempting to run the mac build on a Mac mini running macOS 10.12 (Sierra). I have tried targeting osx.10.10-x64 and osx.10.12-x64 and get the same error. I have also tried to build and publish under .NET Core 1.0.1, and 1.1.0, again with the same error.

I am building on a Windows 10 system, creating standalone builds in each case. I did get my app to run properly when I installed the .NET Core framework on the Mac (and built the app as a framework build), but I need to run standalone builds.

I have installed OpenSSL on the Mac through Homebrew, which is the only external dependency I'm aware of. My project.json file is below.

Any help would be appreciated!

{
  "version": "1.1.0-*",
  "buildOptions": {
    "emitEntryPoint": true
  },

  "dependencies": {
    "Microsoft.NETCore.App": "1.1.0",
    "Newtonsoft.Json": "9.0.1",
    "System.Xml.XmlSerializer": "4.3.0"
  },

  "frameworks": {
    "netcoreapp1.1": {
      "imports": "dnxcore50"
    }
  },

  "runtimes": {
    "centos.7-x64": {},
    "win10-x64": {},
    "win10-x86": {},
    "win7-x64": {},
    "win7-x86": {},
    "osx.10.10-x64": {},
    "osx.10.12-x64": {}
  },

  "description": "XXX gameplay instance server.",
  "title": "XXX"
}

1 Answers1

0

It seems to be an environment problem, creating a new project, using the docker, and copying your project.json work as well.

docker run -v <your app folder>:/app -it --rm  microsoft/dotnet:1.1.0-sdk-projectjson

Inside the container

cd /app
dotnet restore
dotnet publish -c Release -r osx.10.12-x64
exit

Outside of container

chmod +x bin/Release/netcoreapp1.1/osx.10.12-x64/publish/app
./bin/Release/netcoreapp1.1/osx.10.12-x64/publish/app

Link of the test project: https://drive.google.com/open?id=0B9E5H1HYtm8DSFJMSG1CZDNyTGc

Ricardo Fontana
  • 4,583
  • 1
  • 21
  • 32
  • Is it necessary to use docker in this case? Isn't the purpose of a standalone build similar to what docker provides, that is, a self contained portable environment to run on the target machine? I agree that it seems to be an environment problem, it seems like the publish process is not including the correct libraries. I would prefer to fix the core problem in the dotnet build process if possible. But if that doesn't work, it's a good idea to try docker. Thanks for the help! – Paul Chieffo Mar 06 '17 at 16:54
  • Just to be clear, the docker is used only to publish the stand alone app, after this, the docker is not necessary. You can copy and run the app in a new host without .net or docker. I have faced similar problems with standalone apps, and docker is the best way to isolate environment problems. http://stackoverflow.com/questions/42194718/problems-with-net-core-self-contained-publish – Ricardo Fontana Mar 06 '17 at 23:52
  • Thanks Ricardo, I'll give it a try! – Paul Chieffo Mar 07 '17 at 04:47