{"id":18797922,"url":"https://github.com/ahmed605/projectrt","last_synced_at":"2025-04-13T16:32:28.509Z","repository":{"id":224356300,"uuid":"762962059","full_name":"ahmed605/ProjectRT","owner":"ahmed605","description":".NET Native but with CoreRT's ILCompiler","archived":false,"fork":false,"pushed_at":"2024-02-29T22:13:28.000Z","size":1022,"stargazers_count":24,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T07:48:12.291Z","etag":null,"topics":["corert","csharp","dotnet","ilc","ilcompiler","net-native","projectn","projectx","redhawk","uwp"],"latest_commit_sha":null,"homepage":"","language":"C#","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/ahmed605.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2024-02-25T07:14:40.000Z","updated_at":"2025-02-25T19:50:46.000Z","dependencies_parsed_at":"2024-02-29T14:07:48.190Z","dependency_job_id":null,"html_url":"https://github.com/ahmed605/ProjectRT","commit_stats":null,"previous_names":["ahmed605/projectrt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmed605%2FProjectRT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmed605%2FProjectRT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmed605%2FProjectRT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmed605%2FProjectRT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmed605","download_url":"https://codeload.github.com/ahmed605/ProjectRT/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248743951,"owners_count":21154774,"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":["corert","csharp","dotnet","ilc","ilcompiler","net-native","projectn","projectx","redhawk","uwp"],"created_at":"2024-11-07T22:09:59.734Z","updated_at":"2025-04-13T16:32:27.994Z","avatar_url":"https://github.com/ahmed605.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ProjectRT\nExperimental project aiming at making it possible to use [.NET Native](https://learn.microsoft.com/en-us/windows/uwp/dotnet-native/) with [CoreRT](https://github.com/dotnet/corert)'s ILCompiler and MSVC's [`link.exe`](https://learn.microsoft.com/en-us/cpp/build/reference/linking?view=msvc-170) instead of [Bartok](https://en.turkcewiki.org/wiki/Bartok_(compiler))/[Triton](https://web.archive.org/web/20201130194915/https://channel9.msdn.com/Shows/Going+Deep/Mani-Ramaswamy-and-Peter-Sollich-Inside-Compiler-in-the-Cloud-and-MDIL) [MDIL](https://www.freepatentsonline.com/y2011/0258615.html) Compiler of [`nutc_driver.exe` and `rhbind.exe`](https://web.archive.org/web/2020/https://channel9.msdn.com/Shows/Going+Deep/Inside-NET-Native).\n\nCurrently only the __x64__ target is tested and confirmed to be working, but support for __x86__ and __ARM32__ is planned.\n\u003e [!NOTE] \n\u003e *__.NET Native__ already uses __CoreRT__'s ILCompiler for the __ARM64__ target (codenamed **ProjectX**) unlike for the __x86__, __x64__, and __ARM32__ targets so you don't need this project for __ARM64__ targets.*\n\n## Usage\n\u003e [!NOTE]  \n\u003e *Usage guide below is temporary until a proper installation method is there.*\n\n1. **Compile** [`bootstrap`](https://github.com/ahmed605/ProjectRT/tree/master/bootstrap), [`bootstrap_dll`](https://github.com/ahmed605/ProjectRT/tree/master/bootstrap_dll), [`shimAppDll`](https://github.com/ahmed605/ProjectRT/tree/master/shimAppDll), and [`shimExe`](https://github.com/ahmed605/ProjectRT/tree/master/shimExe) on the `Release` configuration.\n\n2. **Copy** the compiled `.lib`s to .NET Native's Nuget package ilc `tools` folder (`.nuget\\runtime.win10-x64.microsoft.net.native.compiler.2.2.12-rel-31116-00\\tools\\x64\\ilc\\tools`).\n\n3. **Download** [`mrt100X_app.lib`](https://github.com/ahmed605/ProjectRT/raw/master/Libs/x64/mrt100X_app.lib) to .NET Native's Nuget package ilc runtime libs folder (`.nuget\\runtime.win10-x64.microsoft.net.native.compiler.2.2.12-rel-31116-00\\tools\\x64\\ilc\\Lib\\Runtime`).\n\n4. **Duplicate** `mrt100_app.dll` and name the duplicated copy `mrt100X_app.dll`.\n\n5. **Copy** `ILCompiler.Compiler.dll`, `ILCompiler.DependencyAnalysisFramework.dll`, `ILCompiler.Host.dll`, `ILCompiler.MetadataTransform.dll`, and `ILCompiler.TypeSystem.dll` from arm64 ilc tools folder to x64 ilc tools folder (`.nuget\\runtime.win10-arm64.microsoft.net.native.compiler.2.2.12-rel-31116-00\\tools\\arm64\\ilc\\tools` -\u003e `.nuget\\runtime.win10-x64.microsoft.net.native.compiler.2.2.12-rel-31116-00\\tools\\x64\\ilc\\tools`).\n\n6. **Open** `ILCompiler.Host.dll` in [dnSpy](https://github.com/dnSpyEx/dnSpy), then navigate to `ILCompilerHost.AddTocModule`, then `Edit Method`, then replace `File.OpenRead(filename)` with `File.OpenRead(filename.Replace(\"win10-x64\", \"win10-arm64\"))`, then `Compile`, and finally `File` \u003e `Save Module`.\n\n7. **Add** this to your app's csproj (tweak the paths as needed)\n```xml\n\u003cUseDotNetNativeSharedAssemblyFrameworkPackage\u003efalse\u003c/UseDotNetNativeSharedAssemblyFrameworkPackage\u003e\n\u003cIlcParameters\u003e/PureNative /LinkPath:\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.38.33130\\bin\\Hostx64\\x64\" /NativeLibPath:\"C:\\Program Files (x86)\\Windows Kits\\10\\Lib\\10.0.22621.0\\um\\x64\"\u003c/IlcParameters\u003e\n```\n\n8. **Profit!**\n\n## Screenshot because why not\n![image](https://github.com/ahmed605/ProjectRT/assets/34550324/4b764ead-490c-477a-920b-282be408713c)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmed605%2Fprojectrt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmed605%2Fprojectrt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmed605%2Fprojectrt/lists"}