diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 19e5fd9d1d..0d1587f028 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -1,7 +1,7 @@ --- title: "Troubleshoot known issues" description: "Learn about .NET MAUI known issues and troubleshooting you can do to resolve these issues." -ms.date: 03/08/2023 +ms.date: 10/02/2023 --- # Troubleshooting known issues @@ -182,3 +182,12 @@ If you receive the error "Could not find a valid Xcode app bundle at '/Library/D ```zsh sudo xcode-select --reset ``` + +## Diagnose issues in Blazor Hybrid apps + + has built-in logging that can help you diagnose problems in your Blazor Hybrid app. There are two steps to enable this logging: + +1. Enable and related components to log diagnostic information. +1. Configure a logger to write the log output to where you can view it. + +For more information, see [Diagnosing issues in Blazor Hybrid apps](~/user-interface/controls/blazorwebview.md#diagnosing-issues). diff --git a/docs/user-interface/controls/blazorwebview.md b/docs/user-interface/controls/blazorwebview.md index f833fbb0ad..97014d4146 100644 --- a/docs/user-interface/controls/blazorwebview.md +++ b/docs/user-interface/controls/blazorwebview.md @@ -138,7 +138,7 @@ The process to add a has a `TryDispatchAsync` method that calls a specified `Action` asynchronously and passes in the scoped services available in Razor components. This enables code from the native UI to access scoped services such as `NavigationManager`: + has a `TryDispatchAsync` method that can call a specified `Action` asynchronously and pass in the scoped services available in Razor components. This enables code from the native UI to access scoped services such as `NavigationManager`: ```csharp private async void MyMauiButtonHandler(object sender, EventArgs e) @@ -156,4 +156,51 @@ private async void MyMauiButtonHandler(object sender, EventArgs e) } ``` +## Diagnosing issues + + has built-in logging that can help you diagnose issues in your Blazor Hybrid app. There are two steps to enable this logging: + +1. Enable and related components to log diagnostic information. +1. Configure a logger to write the log output to where you can view it. + +For more information about logging, see [Logging in C# and .NET](/dotnet/core/extensions/logging). + +### Enable BlazorWebView logging + +All logging configuration can be performed as part of service registration in the dependency injection system. To enable maximum logging for and related components under the `Microsoft.AspNetCore.Components.WebView` namespace, add the following code to where your app's services are registered: + +```csharp +services.AddLogging(logging => +{ + logging.AddFilter("Microsoft.AspNetCore.Components.WebView", LogLevel.Trace); +}); +``` + +Alternatively, to enable maximum logging for every component that uses `Microsoft.Extensions.Logging`, you could use the following code: + +```csharp +services.AddLogging(logging => +{ + logging.SetMinimumLevel(LogLevel.Trace); +}); +``` + +### Configure logging output and viewing the output + +After configuring components to write log information you need to configure where the loggers should write the logs to, and then view the log output. + +The **Debug** logging providers write the output using `Debug` statements, and the output can be viewed from Visual Studio. + +To configure the **Debug** logging provider, first add a reference in your project to the `Microsoft.Extensions.Logging.Debug` NuGet package. Then register the provider inside the call to `AddLogging` that you added in the previous step by calling the `AddDebug` extension method: + +```csharp +services.AddLogging(logging => +{ + logging.AddFilter("Microsoft.AspNetCore.Components.WebView", LogLevel.Trace); + logging.AddDebug(); +}); +``` + +When you run the app from Visual Studio (with debugging enabled), you can view the debug output in Visual Studio's **Output** window. + ::: moniker-end diff --git a/docs/whats-new/TOC.yml b/docs/whats-new/TOC.yml index 19ba98ad08..656e42fe91 100644 --- a/docs/whats-new/TOC.yml +++ b/docs/whats-new/TOC.yml @@ -6,6 +6,8 @@ items: - name: Releases expanded: true items: + - name: .NET 8 + href: dotnet-8.md - name: .NET 7 href: dotnet-7.md - name: Month diff --git a/docs/whats-new/dotnet-8.md b/docs/whats-new/dotnet-8.md new file mode 100644 index 0000000000..24431deb83 --- /dev/null +++ b/docs/whats-new/dotnet-8.md @@ -0,0 +1,65 @@ +--- +title: What's new in .NET MAUI for .NET 8 +description: Learn about the new features introduced in .NET MAUI for .NET 8. +ms.date: 10/02/2023 +--- + +# What's new in .NET MAUI for .NET 8 + +.NET 8 is the successor to .NET 7 and focuses on being unified, modern, simple, and *fast*. Due to working with underlying external dependencies, such as Xcode or Android SDK Tools, the .NET Multi-platform App UI (.NET MAUI) support policy differs from the [.NET and .NET Core support policy](https://dotnet.microsoft.com/platform/support/policy/maui). For more information, see [.NET MAUI support policy](https://dotnet.microsoft.com/platform/support/policy/maui). + +This article lists the new features of .NET MAUI for .NET 8 and provides links to more detailed information on each. + +For information about what's new in .NET 8, see [What's new in .NET 8](/dotnet/core/whats-new/dotnet-8). + +## New functionality + +.NET MAUI for .NET 8 addresses top feedback issues and introduces the following new functionality: + +- gains a `StartPath` property, a `TryDispatchAsync` method, and enhanced logging capabilities. For more information, see [Host a Blazor web app in a .NET MAUI app using BlazorWebView](~/user-interface/controls/blazorwebview.md). + + + + + + + +