Publishing a .NET app that uses Microsoft.Windows.AI.MachineLearning nuget with PublishSingleFile=true fails WinRT activation at runtime with Class not registered (0x80040154 REGDB_E_CLASSNOTREG), because the native DLLs are not embedded in the single .exe.
Fix: add IncludeAllContentForSelfExtract so the native DLLs are extracted at runtime:
<PublishSingleFile>true</PublishSingleFile>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
Publishing a .NET app that uses
Microsoft.Windows.AI.MachineLearningnuget withPublishSingleFile=truefails WinRT activation at runtime withClass not registered (0x80040154 REGDB_E_CLASSNOTREG), because the native DLLs are not embedded in the single.exe.Fix: add
IncludeAllContentForSelfExtractso the native DLLs are extracted at runtime: