Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 3.33 KB

README.md

File metadata and controls

33 lines (22 loc) · 3.33 KB

ProjectRT

Experimental project aiming at making it possible to use .NET Native with CoreRT's ILCompiler and MSVC's link.exe instead of Bartok/Triton MDIL Compiler of nutc_driver.exe and rhbind.exe.

Currently only the x64 target is tested and confirmed to be working, but support for x86 and ARM32 is planned.

Note

.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.

Usage

Note

Usage guide below is temporary until a proper installation method is there.

  1. Compile bootstrap, bootstrap_dll, shimAppDll, and shimExe on the Release configuration.

  2. Copy the compiled .libs 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).

  3. Download 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).

  4. Duplicate mrt100_app.dll and name the duplicated copy mrt100X_app.dll.

  5. 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 -> .nuget\runtime.win10-x64.microsoft.net.native.compiler.2.2.12-rel-31116-00\tools\x64\ilc\tools).

  6. Open ILCompiler.Host.dll in 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 > Save Module.

  7. Add this to your app's csproj (tweak the paths as needed)

<UseDotNetNativeSharedAssemblyFrameworkPackage>false</UseDotNetNativeSharedAssemblyFrameworkPackage>
<IlcParameters>/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"</IlcParameters>
  1. Profit!

Screenshot because why not

image