{"id":15399133,"url":"https://github.com/sharp0802/dhost","last_synced_at":"2026-05-12T07:35:55.567Z","repository":{"id":230217598,"uuid":"778772441","full_name":"Sharp0802/dhost","owner":"Sharp0802","description":"A simple CoreCLR hosting library (.NET 5 or later)","archived":false,"fork":false,"pushed_at":"2024-03-29T02:37:12.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-25T22:34:02.663Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sharp0802.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-03-28T11:24:06.000Z","updated_at":"2024-03-30T11:00:59.000Z","dependencies_parsed_at":"2024-03-28T13:40:39.017Z","dependency_job_id":"b70986fc-3a91-43b5-8fd4-e657aecb304e","html_url":"https://github.com/Sharp0802/dhost","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"ffbbc1e1e4faa2618a7993ea5698c58fcc14e446"},"previous_names":["sharp0802/dhost"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sharp0802%2Fdhost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sharp0802%2Fdhost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sharp0802%2Fdhost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sharp0802%2Fdhost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sharp0802","download_url":"https://codeload.github.com/Sharp0802/dhost/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244722651,"owners_count":20499153,"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":[],"created_at":"2024-10-01T15:46:59.162Z","updated_at":"2026-05-12T07:35:55.538Z","avatar_url":"https://github.com/Sharp0802.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DHost\n\n\u003e [!WARNING]\n\u003e Currently, Only .NET 5.0 or higher is supported.\n\nA simple .NET native-host wrapper for C++\n\n## How to build\n\n### Summary\n\n```shell\n$ mkdir build\n$ cd build\n$ cmake -DNETHOST_RUNTIME_IDENTIFIER=\"linux-x64\" -DNETHOST_RUNTIME_VERSION=\"8.0.3\" ../\n$ make # use what you configured with cmake\n```\n\n### CMake Variables\n\n\u003e [!WARNING]\n\u003e Target platform not altered even if mismatched with `NETHOST_RUNTIME_IDENTIFIER`.\n\u003e To change target platform, Use cross-platform tools such as MINGW.\n\n- `NETHOST_RUNTIME_IDENTIFIER` : .NET RID (See [Catalog](https://learn.microsoft.com/en-us/dotnet/core/rid-catalog))\n- `NETHOST_RUNTIME_VERSION` : .NET Runtime Version (See [Version List](https://www.nuget.org/packages/runtime.linux-x64.Microsoft.NETCore.DotNetAppHost#versions-body-tab))\n\n## How to use (Sample)\n\n- clr.csproj\n\n```xml\n\u003cProject Sdk=\"Microsoft.NET.Sdk\"\u003e\n\n  \u003cPropertyGroup\u003e\n    \u003cOutputType\u003eExe\u003c/OutputType\u003e\n    \u003cTargetFramework\u003enet8.0\u003c/TargetFramework\u003e\n    \u003cImplicitUsings\u003eenable\u003c/ImplicitUsings\u003e\n    \u003cNullable\u003eenable\u003c/Nullable\u003e\n  \u003c/PropertyGroup\u003e\n\n\u003c/Project\u003e\n```\n\n- Program.cs\n\n```c#\ninternal static class Program\n{\n\tpublic static void Entry()\n\t{\n\t\tConsole.WriteLine($\"Hello from '{typeof(Program).AssemblyQualifiedName}'\");\n\t}\n\n\tpublic static void Main()\n\t{\n\t\t// dummy\n\t}\n}\n```\n\n- main.cpp\n\n\u003e [!IMPORTANT]\n\u003e When specifying type, Assembly qualified name is required.\n\n```c++\n#include \"library.h\"\n\nint main()\n{\n    DHost ctx(\"clr.runtimeconfig.json\");\n\n    if (!ctx.LoadAssembly(\"clr.dll\"))\n    {\n        puts(\"asm\");\n        return -1;\n    }\n\n    const auto main = reinterpret_cast\u003cvoid(*)()\u003e(ctx.LoadMethod(\n        \"Program, clr, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\",\n        \"Entry\",\n        \"System.Action, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e\"));\n    if (!main)\n    {\n        puts(\"fptr\");\n        return -1;\n    }\n\n    main();\n\n    return 0;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharp0802%2Fdhost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharp0802%2Fdhost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharp0802%2Fdhost/lists"}