CsWinRT
CsWinRT copied to clipboard
[R2R | CsWinRT Component] Allow CsWinRT component to deploy .NET dlls as ready to run.
Hello.
Summary
In an architecture where we have a WinUI 3 C++ application and a CsWinRT component dependency, we would like to have a simple way to deploy it as ready to run to reduce JIT time and improve performance.
Rationale
Since Windows App SDK does not support Native AOT yet, and for any other reason, a native C++ application might be a good approach to reduce overhead of loading .NET runtime dlls during app launch.
With this, as far as I know, there is not a way to allow the C++ app to use publish profiles and therefore deploy it as ReadyToRun.
At the moment I achieved this by:
- Building the entire solution with msbuild.exe
- Manually building the CsWinRT component by using msbuild.exe + publish profiles in it,
- Manually copying all dlls that got ReadyToRun (usually double of the size now) and replace it the ones from first build.
Important Notes
Here is a sample project for your reference of a similar architecture:
- https://github.com/RobsonPontin/WinUI3/tree/main/DotNetSelfContainedNativeApp
Open Questions
- Could this be possible by building the C++ App directly with msbuild?
- Could this be also available on VS?
- If this is possible what could be a timeline?
ReadyToRun doesn't support native DLLs AFAIK.
I think it's already possible to use R2R together with CsWinRT for a C# WinRT component?