How to distribute .net core 2.0 console application on osx

I use Visual Studio for Mac, my application is written, it does what I want. The user target platform is OSX. It relies on 2 Nuget packages with its dependencies, in particular:

  • Netmq
  • Microsoft.Extensions.Configuration.CommandLine

I ran the following command in the buildapplication:

dotnet build -c Release -r osx.10.11-x64

The result tells me that it succeeded, and shows me where it places the files.

This folder contains the following files, this folder is what I assume that I am distributing it to the user, but this leads to errors, so this question:

MyApp <---- executable
MyApp.deps.json
MyApp.dll
MyApp.pdb
MyApp.runtimeconfig.dev.json
MyApp.runtimeconfig.json
libhostfxr.dylib
libhostpolicy.dylib

, , dotnet. , ( MyApp aka ./MyApp), :

An assembly specified in the application dependencies manifest (MyApp.deps.json) was not found:
package: 'AsyncIO', version: '0.1.26'
path: 'lib/netstandard1.3/AsyncIO.dll'

AsyncIO NetMQ, . , ./MyApp . , Nuget, , , . , Mac. , , - :

dotnet run -p MyApp.csproj

, , nuget.

:

dotnet MyApp.dll

. , , . , dotnet <dll> , .

-, , , netcore2.0 ?

- :

dotnet publish -c Release --framework netcoreapp2.0 --runtime osx.10.11-x64

DLL DLL . publish , .

2 , :

https://docs.microsoft.com/en-us/dotnet/core/deploying/deploy-with-cli https://docs.microsoft.com/en-us/dotnet/core/tools/project-json-to-csproj

+4
1

build publish.

dotnet build . , , nuget.

dotnet publish . .

: .

, Framework, , . , .

FDD, :

dotnet publish -c Release --framework netcoreapp2.0

, , .NET Core .

SCD, :

dotnet publish -c Release --framework netcoreapp2.0 --runtime osx-x64

(Btw, , osx-x64, osx.10.11-x64)

? / . --runtime, , SCD, .NET Core. , , .

FDD, bin/Release/netcoreapp2.0/publish . ( bin/Release/netcoreapp2.0/) . dotnet ./path/to/publish/MyApp.dll.

https://docs.microsoft.com/en-us/dotnet/core/deploying/ .

+5

Source: https://habr.com/ru/post/1687797/


All Articles