I have made a .net core console app in Visual Studio. I want to package it now as an executable for both windows & mac.
I added the runtime section to project.json.
This is my projects.json based on what I saw here: https://docs.microsoft.com/en-us/dotnet/articles/core/deploying/index#self-contained-application
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true
},
"dependencies": {
"AngleSharp": "0.9.9",
"CsvHelper": "2.16.3",
"Microsoft.NETCore.App": {
"version": "1.0.1"
}
},
"frameworks": {
"netcoreapp1.0": {
}
},
"runtimes": {
"win10-x64": {},
"osx.10.10-x64": {}
}
}
This creates a folder in debug/release called win10-x64
that includes an executable but there is no folder for osx.
Am I missing a dependency to target this OS?
The answer was to publish it from the command line
dotnet publish -r osx.10.10-x64
Then the folder /osx.10.10-x64/publish/
holds a file that can be run on a mac that has the SDK installed.
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