How can I run a .net console application on mac os

I just installed Visual studio for MAC and created a hello world console application when I click play in the bottom window (application output), I can see the world hello.

However, how do I run this application from the command line?

If I try. /myapp.dll, I get permission even after sudo su.

therefore, not sure how to run it

this is my json

{
  "version": "1.0.0-*",
  "buildOptions": {
    "debugType": "portable",
    "emitEntryPoint": true
  },
  "dependencies": {},
  "frameworks": {
    "netcoreapp1.0": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "version": "1.0.0"
        }
      }
    }
  },
  "runtimes": {
    "win10-x64": {},
    "osx.10.10-x64": {}
  }
}

Update

I performed the recovery of dotnet and dotnetrun, at first I got this error: Cannot find the execution target for the .NETCoreApp platform, Version = v1.0, compatible with one of the target versions: osx.10.12-x64. Possible reasons:

Then I modified my .json project as follows:

{
  "version": "1.0.0-*",
  "buildOptions": {
    "debugType": "portable",
    "emitEntryPoint": true
  },
  "dependencies": {},
  "frameworks": {
    "netcoreapp1.0": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "version": "1.0.0"
        }
      }
    }
  },
  "runtimes": {
    "win10-x64": {},
    "osx.10.12-x64": {}
  }
}

: System.Threading.Tasks 4.0.11 System.Threading.Tasks .NETCoreApp, Version = v1.0, , osx.10.12-x64.   System.Threading.Timer 4.0.1 System.Threading.Timer .NETCoreApp, Version = v1.0, , osx.10.12-x64.

J

, OSX, ?

+4
1

dotnet, :

dotnet myapp.dll

, ().

: System.Threading.Tasks 4.0.11

.json . :

"netcoreapp1.0": {
  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.0",
      "type": "platform"
    }
  }
}
+7

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


All Articles