question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MAUI Blazor for Windows - Remote Debugging: "ERR_ADDRESS_INVALID"

See original GitHub issue

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”:

Screenshot 2022-08-15 214507

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

  1. Create a project with the Blazor MAUI Template
  2. Remove all the TargetFrameworks tags from .csproj and keep just the net6.0-windows10.0.19041.0
  3. On lauch launchSettings.json, add a new profile to deploy to a remote device Example:
{
  "profiles": {
    "Windows Machine": {
      "commandName": "MsixPackage",
      "nativeDebugging": false
    },
    "Windows Remote": {
      "commandName": "MsixPackage",
      "nativeDebugging": false,
      "remoteDebugEnabled": true,
      "remoteDebugMachine": "192.168.137.1",
      "authenticationMode": "None"
    }
  }
}
  1. On the another device (Running Windows 11 21H2 x64), start the Visual Studio 2022 Remote Debugger (usually i’m using without Authentication)
  2. Start Debugging from Visual Studio 2022 using the Remote Profile
  3. The app should be deployed and opened on the remote Device
  4. The BlazorWebView component doesn’t work

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

No logs found for this issue.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
miguelkmarquescommented, Nov 2, 2022

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!

1reaction
miguelkmarquescommented, Aug 19, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Debug .NET MAUI Blazor Hybrid Windows UI
There is a way to "remotely inspect" your app using the browser developer tool (F12). First, check if you added the builder.Services.
Read more >
Deploy and debug your .NET MAUI app on Windows
This article explains how to configure Windows 10 and Windows 11 for .NET MAUI app deployment and debugging.
Read more >
Debug ASP.NET Core Blazor WebAssembly
In the browser, attempt to commence remote debugging by pressing Shift + Alt + d . The browser must be running with remote...
Read more >
Connect to local web services from Android emulators and ...
Learn how a .NET MAUI app running in the Android emulator or iOS simulator can consume a ASP.NET Core web service running locally....
Read more >
Debugging maui app using WSA - VS Debugger ...
I installed Windows SubSystem for Android and tried creating a "File -> New" MAUI app using blazor. When I press F5 to debug, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found