{"id":16715244,"url":"https://github.com/theangrybyrd/dotnet-mono","last_synced_at":"2025-03-21T20:33:53.800Z","repository":{"id":143647653,"uuid":"83480660","full_name":"TheAngryByrd/dotnet-mono","owner":"TheAngryByrd","description":"dotnet utility to run .net full apps using mono on OSX/Linux","archived":false,"fork":false,"pushed_at":"2019-10-02T16:40:27.000Z","size":1329,"stargazers_count":52,"open_issues_count":3,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-13T21:08:41.053Z","etag":null,"topics":["dotnet","dotnet-cli","dotnet-core","fsharp","mono","monodevelop"],"latest_commit_sha":null,"homepage":"","language":"F#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheAngryByrd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-28T21:24:42.000Z","updated_at":"2024-05-25T17:43:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"85c93722-3289-4b7d-b0c3-6dd9a77d13b1","html_url":"https://github.com/TheAngryByrd/dotnet-mono","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAngryByrd%2Fdotnet-mono","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAngryByrd%2Fdotnet-mono/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAngryByrd%2Fdotnet-mono/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAngryByrd%2Fdotnet-mono/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheAngryByrd","download_url":"https://codeload.github.com/TheAngryByrd/dotnet-mono/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221818958,"owners_count":16885862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotnet","dotnet-cli","dotnet-core","fsharp","mono","monodevelop"],"created_at":"2024-10-12T21:08:47.683Z","updated_at":"2024-10-28T10:50:28.715Z","avatar_url":"https://github.com/TheAngryByrd.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dotnet-mono\n\n[![NuGet Badge](https://img.shields.io/nuget/vpre/dotnet-mono.svg)](https://www.nuget.org/packages/dotnet-mono/)\n\n## What is dotnet-mono?\nThis a [dotnet tool](https://docs.microsoft.com/en-us/dotnet/core/tools/?tabs=netcore2x) that allows you to run executables created by the new dotnet core sdk project format that target full framework (net45-net462) on osx/linux.\n\n## Why would you create this?\nSince RC4 of the dotnet tooling, `dotnet run` [does not run](https://github.com/dotnet/cli/issues/6043) executables [created from mono](https://github.com/dotnet/sdk/issues/335).  This tools sets to resolve that.\n\n### Why not just `mono myapp.exe`?\nBecause I really like [dotnet watch](https://github.com/aspnet/DotNetTools/tree/dev/src/Microsoft.DotNet.Watcher.Tools) which watches for changes in files and reruns the specific dotnet command you give.  Since `dotnet run` doesn't run mono apps, I wanted a way to get continuous feedback when targeting mono as an executable.\n\n## How to install\n\nAdd this element your csproj/fsproj/vbproj.\n\n```\n  \u003cItemGroup\u003e\n    \u003cDotNetCliToolReference Include=\"dotnet-mono\" Version=\"*\" /\u003e\n  \u003c/ItemGroup\u003e\n```\n\nor use [paket to add clitool](https://fsprojects.github.io/Paket/nuget-dependencies.html#Special-case-CLI-tools) via paket.depedencies \n\n```\nclitool dotnet-mono\n```\n\n\n### Options\n\n```\n$ dotnet mono --help\n\nMuch like dotnet-run you can specify dotnet mono [options] [[--] \u003cadditional arguments\u003e...]] to pass arguments to the underlying program.\nUSAGE: dotnet-mono [--help] [--project \u003cproject\u003e] [--framework \u003cframework\u003e] [--runtime \u003cruntime\u003e] [--inferruntime] [--configuration \u003cconfiguration\u003e] [--restore] [--no-restore]\n                   [--frameworkpathoverride=\u003cframeworkPathOverride\u003e] [--monooptions=\u003cmonoOptions\u003e] [--programoptions=\u003cprogramOptions\u003e] [--loggerlevel \u003clogLevel\u003e] [--no-build] [--purge-system-net-http]\n\nOPTIONS:\n\n    --project, -p \u003cproject\u003e\n                          (Optional) Specify path to proj file.  Will default to current directory.\n    --framework, -f \u003cframework\u003e\n                          (Mandatory) Specify a framework.  Most likely net462.  List available here: https://docs.microsoft.com/en-us/nuget/schema/target-frameworks\n    --runtime, -r \u003cruntime\u003e\n                          (Optional) Specify a runtime. List available here: https://github.com/dotnet/docs/blob/master/docs/core/rid-catalog.md.  You will probably either need to run dotnet restore\n                          properly with runtime or pass --restore.\n    --inferruntime        (Optional) Try to run explicitly on the current runtime. You will probably either need to run dotnet restore properly with runtime or pass --restore.\n    --configuration, -c \u003cconfiguration\u003e\n                          (Optional) Specify a configuration. (Debug|Release|Others) Will default to Debug\n    --restore             (Optional) Will attempt dotnet restore\n    --no-restore          (Optional) Will pass --no-restore to dotnet build.\n    --frameworkpathoverride=\u003cframeworkPathOverride\u003e\n                          (Optional) Set FrameworkPathOverride as Environment Variable or as argument.  It will try to infer based on known good locations on osx/linux.\n    --monooptions, -mo=\u003cmonoOptions\u003e\n                          (Optional) Flags to be passed to mono.\n    --programoptions, -po=\u003cprogramOptions\u003e\n                          (Optional) Flags to be passed to running exe.\n    --loggerlevel \u003clogLevel\u003e\n                          (Optional) LogLevel for dotnet-mono defaults to Info (Verbose|Debug|Info|Warn|Error|Fatal)\n    --no-build            (Optional) Will attempt to skip dotnet build.\n    --purge-system-net-http\n                          (Optional) Mono has issues with HttpClient noted here: https://github.com/dotnet/corefx/issues/19914 ...This will attempt to resolve them.\n    --help                display this list of options.\n\n```\n\n### Example Usage\n\nCurrently dotnet tooling must be used from the same directory you put the reference in your project files.\n\n```\ncd src/MyCoolMonoApp/\ndotnet mono -f net462  -mo=\"--arch=64 --debug\" -po=\"--help\"\n```\n\nor with the `dotnet watch` tool to constantly rebuild/run your mono app\n```\ndotnet watch mono -f net462  -mo=\"--arch=64 --debug\" -po=\"--help\"\n```\n\n\n# FAQ\n\n#### When should I use dotnet-mono?\nWhen you want to be able to run mono applications (your project must produce an exe) with the dotnet cli tooling and not have to figure out where your executable was output.\n\n\n#### Can I just dotnet build?\nIf you set `export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/` in your `build.sh`or in your `.bashrc` or `.bash_profile` you can just do `dotnet build` without this tool. See: https://github.com/dotnet/netcorecli-fsc/wiki/.NET-Core-SDK-1.0.1#using-net-framework-as-targets-framework-the-osxunix-build-fails Additionally you can set other project properties see https://github.com/dotnet/sdk/issues/335#issuecomment-368669050. \n\n\n#### How do I run my tests or how about a `dotnet test` equivalent?\nUnfortunately this is in a [very](https://github.com/Microsoft/vstest/issues/1284) [poor](https://github.com/Microsoft/vstest/issues/445#issuecomment-290723152) [state](https://github.com/dotnet/cli/issues/3073) for mono.  If you're using `xunit`, I added mono support to [dotnet-xunit](https://www.nuget.org/packages/dotnet-xunit/2.3.1) and you can use that dotnet tool to run the tests instead.  If you're using `Expecto` since it's just a console app you can run it.  I'm not sure about other test runners.\n\n\n----\n\n\n### A word on FrameworkPathOverride\n\n*Now* this tool will attempt to resolve `FrameworkPathOverride` for you.  If these defaults don't work (because of specific folder paths) you can still used the workaround below.\n\n\nTo workaround https://github.com/dotnet/sdk/issues/335 you'll need to  set `FrameworkPathOverride` environment variable to use .net framework assemblies installed by mono\n\n  Find where `.../mono/4.5/mscorlib.dll` is on your machine and set `FrameworkPathOverride` as an environment variable\n\n  - Best overall method\n\n    ```\n    export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/\n    ```\n  - OSX (assuming mono install with xamarin studio): \n\n    ```\n    export FrameworkPathOverride=/Library/Frameworks/Mono.framework/Versions/4.6.2/lib/mono/4.5/\n    ```\n  - OSX (assuming mono installed with brew): \n\n    ```\n    export FrameworkPathOverride=/usr/local/Cellar/mono/4.6.2.16/lib/mono/4.5/\n    ```\n  - Debian: \n\n    ```\n    export FrameworkPathOverride=/usr/lib/mono/4.5/\n    ``` \n  \n\n### Killing dotnet mono\n\nSince `dotnet mydevtool` creates a subprocess https://github.com/dotnet/cli/issues/6122 it's best to kill this as a process group rather than just the top level parent. \n\n* Find dotnet mono parent process, which in the example below is 93625\n\n```\n$ ps aux | grep dotnet\nmyusername        93675   0.0  0.0  2434840    796 s014  S+    6:55PM   0:00.00 grep dotnet\nmyusername        93658   0.0  0.1   723412  21940 s010  S+    6:55PM   0:00.27 mono /Users/myusername/Documents/GitHub/dotnet-mono/example/bin/Debug/net462/example.exe\nmyusername        93627   0.0  0.2  4936872  26432 s010  S+    6:54PM   0:00.44 /usr/local/share/dotnet/dotnet exec --depsfile /Users/myusername/.nuget/packages/.tools/dotnet-mono/0.1.4-alpha006/netcoreapp1.0/dotnet-mono.deps.json --additionalprobingpath /Users/myusername/.nuget/packages /Users/myusername/.nuget/packages/dotnet-mono/0.1.4-alpha006/lib/netcoreapp1.0/dotnet-mono.dll -f net462\nmyusername        93625   0.0  0.4  4958660  60736 s010  S+    6:54PM   0:00.63 dotnet mono -f net462\n```\n* `kill -INT -93625`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheangrybyrd%2Fdotnet-mono","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheangrybyrd%2Fdotnet-mono","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheangrybyrd%2Fdotnet-mono/lists"}