UnigramDev/Unigram/develop • 202abcf • 4 files, +484/-2
Build the app a second way, on .NET 10 and CsWinRT
Telegram.Modern.csproj sits beside Telegram.csproj and compiles the same sources
as a UWP XAML app on net10.0-windows10.0.26100.0. Zero errors, all 1250 sources
and all 473 pages, with PublishAot still off. .NET Native is untouched: nothing
here changes what Telegram.csproj builds.
It cannot be one project. UseDotNetNativeToolchain exists only in the legacy
project system and UseUwp only in SDK-style, and neither can produce the other's
output - the wall Telegram.Benchmarks.NetNative already hit.
Sdk.props is imported by hand because three properties have to precede it. The
output paths, so the two projects do not share obj\ and bin\, and
DefaultItemExcludes - without which the SDK's **/*.cs glob compiles
Telegram.csproj's own generated output, its XamlTypeInfo.g.cs and every page's
.g.cs and the ilc sources under bin\, as if they were app source. That was 417
errors that read like toolchain incompatibility and was not.
The local WinRT components are projected rather than referenced: a bare winmd
Reference, which is what Telegram.csproj does for RLottie, is NETSDK1130 here.
CsWinRT generates the projections instead, and Win2D's winmd goes in as an input
so that RLottie's CanvasBitmap signatures resolve, while Win2D itself keeps
coming from its own package.
TdParsers is mirrored by hand. The generator reads the property and the source
reads the constants, so when the two projects disagree the generated parser calls
helpers that were compiled out - 3055 errors in one generated file.
Two source fixes, both also valid for .NET Native:
- Extensions.cs takes using WinRT; inside the existing NET9_0_OR_GREATER guard.
IBuffer.As<T> is CsWinRT's cast helper and that namespace does not exist under
.NET Native, so the using cannot sit with the others.
- PlaceholderHelper passes (Window)null. CsWinRT gives every projected runtime
class an IObjectReference constructor, which makes a bare null ambiguous.
- Extensions.cs hoists a CancellationTokenRegistration out of its own
initializer: the local function that captures it is converted to a delegate
inside the expression that assigns it, which definite assignment rejects at a
modern LangVersion and the legacy project's 14.0 does not.
net10-port-todo.md carries the plan, what the three spikes established, and the
traps worth not re-learning.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
UnigramDev/Unigram/develop • 7546df5 • 1 files, +15/-10
Record that the .NET 10 build is green
Phase 3 said the XAML pass was failing; it is not. WMC9999 did not survive a
clean pass and reads as incremental state, which is worth writing down either way
since it names no file when it happens.
Also folds in the two changes made since: AssemblyInfo.cs excluded from the modern
project rather than GenerateAssemblyInfo turned off, and the locale helper now
living in Locale.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
#unigram
Post #20696
24