You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WinAppSDK 1.6+ and CsWinRT 2.1.1 have released in August and added major support for NativeAOT with .NET 8. This means that you can build WinAppSDK apps or apps using WinRT APIs and use the <PublishAot>true</PublishAot> property in your project to make the build process trim and compile your entire project down into one native DLL/EXE.
How to fix it?
The Microsoft.Web.WebView2 Nuget package needs to be updated to build with CsWinRT 2.1.1 in order to get this benefit as well. I think literally just update your CsWinRT dependency and rebuild to get updated projections.
What is broken?
Until this is fixed, you can build a WinAppSDK NativeAOT app that works fine until the WebView2 classes are called. They will fail with the message:
Cannot create an RCW factory for implementation type 'Windows.Foundation.IAsyncOperation`1[Microsoft.Web.WebView2.Core.CoreWebView2Environment]'.
Importance
Blocking. My app's basic functions are not working due to this issue.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
No response
SDK Version
1.0.2783-prerelease
Framework
WinUI3/WinAppSDK
Operating System
Windows 11
OS Version
22635.4145
Repro steps
Create a WinAppSDK 1.6 app with .NET 8 and include a WebView2 component.
Add <PublishAot>true</PublishAot> to your project file.
Publish the app (triggering the full compilation to native code) and try to run it.
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
No, this never worked
Last working version (if regression)
No response
The text was updated successfully, but these errors were encountered:
WinAppSDK 1.6+ and CsWinRT 2.1.1 have released in August and added major support for NativeAOT with .NET 8. This means that you can build WinAppSDK apps or apps using WinRT APIs and use the <PublishAot>true</PublishAot> property in your project to make the build process trim and compile your entire project down into one native DLL/EXE.
How to fix it?
The Microsoft.Web.WebView2 Nuget package needs to be updated to build with CsWinRT 2.1.1 in order to get this benefit as well. I think literally just update your CsWinRT dependency and rebuild to get updated projections.
What is broken?
Until this is fixed, you can build a WinAppSDK NativeAOT app that works fine until the WebView2 classes are called. They will fail with the message:
Cannot create an RCW factory for implementation type 'Windows.Foundation.IAsyncOperation`1[Microsoft.Web.WebView2.Core.CoreWebView2Environment]'.
Importance
Blocking. My app's basic functions are not working due to this issue.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
No response
SDK Version
1.0.2783-prerelease
Framework
WinUI3/WinAppSDK
Operating System
Windows 11
OS Version
22635.4145
Repro steps
Create a WinAppSDK 1.6 app with .NET 8 and include a WebView2 component.
Add <PublishAot>true</PublishAot> to your project file.
Publish the app (triggering the full compilation to native code) and try to run it.
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
What happened?
WinAppSDK 1.6+ and CsWinRT 2.1.1 have released in August and added major support for NativeAOT with .NET 8. This means that you can build WinAppSDK apps or apps using WinRT APIs and use the
<PublishAot>true</PublishAot>
property in your project to make the build process trim and compile your entire project down into one native DLL/EXE.How to fix it?
The Microsoft.Web.WebView2 Nuget package needs to be updated to build with CsWinRT 2.1.1 in order to get this benefit as well. I think literally just update your CsWinRT dependency and rebuild to get updated projections.
What is broken?
Until this is fixed, you can build a WinAppSDK NativeAOT app that works fine until the WebView2 classes are called. They will fail with the message:
Importance
Blocking. My app's basic functions are not working due to this issue.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
No response
SDK Version
1.0.2783-prerelease
Framework
WinUI3/WinAppSDK
Operating System
Windows 11
OS Version
22635.4145
Repro steps
<PublishAot>true</PublishAot>
to your project file.Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
No, this never worked
Last working version (if regression)
No response
The text was updated successfully, but these errors were encountered: