-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MAUI] .NET 9 GA BlazorWebView not rendering on ARM64 Windows Desktop #26003
Comments
Also, FWIW, attempting to install WebView2 from here fails: |
A C++ console app w/ Nuget package
Here's the code: #include <iostream>
#include <windows.h>
#include <wrl.h>
#include "WebView2.h"
int main()
{
// Initialize COM library
HRESULT hr = CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
if (FAILED(hr))
{
std::cerr << "Failed to initialize COM library. HRESULT: " << hr << std::endl;
return 1;
}
// Get the WebView2 Runtime version
LPWSTR versionInfo = nullptr;
hr = GetAvailableCoreWebView2BrowserVersionString(nullptr, &versionInfo);
if (SUCCEEDED(hr) && versionInfo != nullptr)
{
std::wcout << L"WebView2 Runtime version: " << versionInfo << std::endl;
CoTaskMemFree(versionInfo);
}
else
{
std::cerr << "WebView2 Runtime not found or failed to retrieve version. HRESULT: " << hr << std::endl;
}
// Uninitialize COM library
CoUninitialize();
return 0;
} |
Thanks for contacting us. |
@mkArtakMSFT great idea, sorry I didn't think of that. Seems that the WinForms version works fine: |
This issue has been verified using Visual Studio 17.13.0 Preview 1.0 (9.0.10&9.0.0 ). Can repro on Windows platform. but can't repro in 8.0.100 by the way, Debug breaks from 9.0.0-rc.2.24503.2 to 9.0.0-preview.1.9973, so we can't verify it. and verify it on 8.0.100 |
I see the same behavior. BlazorWebView doesn't render with .Net 9 GA on an ARM4 laptop. This does render if I build the same BlazorHybrid Maui app with .Net 8. IIRC this app used to work fine with .Net 9 RC1 and RC2, and so possibly this is a regression from .Net 9 RC2 to GA. |
Bumping this. MAUI Hybrid is broken on Qualcomm Snapdragon AI PCs, and it had worked in RC2... |
Any update on when this is likely to get fixed? |
I too am seeing this issue on a new Surface Pro Laptop 7. |
Does a normal WebView control work in MAUI? Does a WebView control work in a plain WinUI application? |
I know for some part of .NET 9, the webview component was updated, so it is packaged differently and may be the reason. |
I closed 2 duplicate issues, so lets keep the discussion centralized here. In one of the issues I saw a comment that mentions
@dhindrik can you be a bit more specific? Where did you see it and what edit did you make? Can more people confirm this works? |
Hey @jfversluis thanks for efforts of putting issues into a central place. Thanks to you linking the comment, I gave it ago and the good news is changing the configuration from AnyCPU to ARM64 DOES fix the issue. My setup Steps I took By default VS looks like this with one configuration. If you debug or run without debug with this, you get this: So I created a new configuration for arm64 and voila it's working (interaction works, hot reload works). Thanks @dhindrik and @@jfversluis ! Just an additional FYI, I only needed to specify the platform in the MAUI project: |
This is great, thanks @o-l-i-g for confirming! Wonder what the root cause is in the MAUI build system, and why the automated regression testing didn't catch it. |
I verified that @o-l-i-g's workaround (new ARM64 configuration) solved both this issue, as well as the related issue #26116, for me. I tested this with an existing .Net 9 solution containing both a .Net Maui Blazor Hybrid project as well as a .Net Maui project containing a lot of HybridWebView controls. I also verified this on two different machines - a Windows ARM laptop as well as a Mac Mini running Windows ARM through Parallels. Before testing this I updated Windows 11 and Visual Studio 2022, and on the Mac Mini (but not the Windows ARM laptop) I had to do a clean / rebuild for this to work. Hopefully the documentation will be updated to include this setup step for those running Windows on ARM. |
AnyCPU is the correct way, I believe there is an issue in the new webview2 nuget package as it is not including the correct binaries. I will investigate. |
Found the issue, there is a missing condition in the WebVIew2 targets for ARM64: MicrosoftEdge/WebView2Feedback#5104 I believe the workaround until we get a fix is to explicitly set ARM64 as the platform when running on ARM: <Platform Condition="$(TargetFramework.Contains('-windows')) and '$([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture)' == 'arm64'">arm64</Platform> |
The regression occurred because older versions of the WASDK included the WebView2 components as part of their package. In the later versions, it is a separate NuGet with its own targets. So, this is rather an existing issue in an older package that is now used instead of WASDK duplicating the files. Hopefully we get a fix soon. |
MicrosoftEdge/WebView2Feedback#5104 (comment)
|
🚨 Fix/workaround is here.
Description
I'm unable to properly render the Blazor Hybrid template for Windows Desktop on my new ARM64 machine (Snapdragon X Elite Thinkpad T14s Gen 6):
The web version runs fine:
...and it works fine on my Intel x64 desktop:
I've installed the GA .NET 9 SDK and run
dotnet workload update
(VS 2022, VS 2022 Preview, and VS code + MAUI extension all up to date). I haven't (yet) experimented with any updating/replacing the built-in WebView2.Here's a dump of info:
VS 2022 Info:
Steps to Reproduce
Link to public reproduction project repository
No response
Version with bug
9.0.0 GA
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
net9.0-windows10.0.19041.0
Did you find any workaround?
No
Relevant log output
The text was updated successfully, but these errors were encountered: