Open miguelkmarques opened 2 years ago
Since our project is just for Windows, i decided to try the Blazor App inside a dotnet 6.0 WPF Project with a Windows Application Packaging Project for side-loading.
By following this Tutorial Build a Windows Presentation Foundation (WPF) Blazor app, which uses the nuget package Microsoft.AspNetCore.Components.WebView.Wpf
.
And i found that deploying the App from Visual Studio to Debug on a Remote machine, the BlazorWebView component on MainWindow.xaml works perfectly well!
Unfortunately i could not make the BlazorWebView to work on the MAUI project on Remote debugging.
For now we are going to use WPF.
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.
Hi folks. For those that are hitting this issue, could you please share with us some details about why you are remote debugging your .NET MAUI Blazor app? We're trying to understand how many folks are likely to be impacted by this issue. Thanks!
In our case, it's because we are developing an application for Windows devices that have Mobile Broadband Radio capabilities with SIM Card or eSIM, to make use of Mobile Broadband API. The app targets multiple types of devices (x64 and ARM64) and phone carriers, since it differs based on the carrier as well. The possibility to remote debug is to easily use your main company computer that have access to corporate network and git repository to develop and debug on multiple devices with ease, otherwise we would need to install Visual Studio on every machine and always copy the code to debug, and we need to debug with low-end devices with limited RAM for example, running Visual Studio would be difficult. Thanks!
Verified this issue with Visual Studio Enterprise 17.7.0 Preview 2.0. Can repro on MauiBlazor project.
Hi folks. For those that are hitting this issue, could you please share with us some details about why you are remote debugging your .NET MAUI Blazor app? We're trying to understand how many folks are likely to be impacted by this issue. Thanks!
We are using the remote debugger for testing Touch Screen devices. We've also confirmed this issue on latest version of net8 RC and VS2022 Preview.
Confirmed this repros on my machine too.
One thing I suspected was that the wwwroot
folder was somehow not getting published, but I see it on the remote machine. Will debug some more.
I'm still not sure I've fully understood things, but here's what I think I've found for BlazorWebView on .NET MAUI Windows on WinUI in this code:
Package.Current.InstalledLocation.Path
) and use regular good old System.IO
to find the file you want using a relative assetPath
. This has various APIs to check what's on disk without throwing.Package.Current.InstalledLocation.OpenStreamForReadAsync(assetPath)
. This API immediately throws if the file doesn't exist.await Package.Current.InstalledLocation.TryGetItemAsync(assetPath)
. This API returns null
if the file doesn't exist, and otherwise returns the itemAppContext.BaseDirectory
(because there's no 'package location')Apparently in the Remote Debugging scenario, (ii) and/or (iii) do not seem to work as expected (or, at least, not as we expected).
I'm not sure why we didn't use option (i) for all scenarios to begin with. It might have been because we wanted to use the most WinUI-ish APIs available. Or maybe we found a case where we had to use the WinUI Storage APIs (but so far I can't find a case where it's required - and we do have a case where it doesn't work).
Running into the same issue with our .NET MAUI app with Blazor components, using Visual Studio Enterprise 17.8.6. Happens with a Release build as well.
Description
I'm trying to Debug a MAUI Blazor App for Windows only on a Remote machine. I have added on
launchSettings.json
a new profile to Deploy and Debug on another device, using Visual Studio 2022 Remote Debugger.The app is deployed to the remote device successfully and after the app opens the BlazorWebView doesn't work with the error "ERR_ADDRESS_INVALID":
Remote Debugging with the template of MAUI Project with no Blazor works perfectly well.
Unfortunately on the Debug Output there are no errors or exceptions when executing, so i have no clue as to what is happening because when i execute using my local machine, it works normally. I have tried with 2 different devices, running Windows 11 x64 and both had the same issue, but when i publish the application for Windows following Publish a .NET MAUI app for Windows and install on the device that i was trying to Remote Debug, the application works normally, the issue appears to be just when the application is deployed from Visual Studio.
For this project that i'm working on, i really need to Debug our application using a Remote Device, so without this possibility it becomes time consuming, because i have to publish the application, copy and paste to another device, install and analyse the logs generated.
Steps to Reproduce
Visual Studio 2022 17.4.0 Preview 1.0
launchSettings.json
, add a new profile to deploy to a remote device Example:Version with bug
6.0.400
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
windows10.0.19041.0
Did you find any workaround?
No response
Relevant log output