Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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

<xref:Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView> 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 <xref:Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView> 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).
49 changes: 48 additions & 1 deletion docs/user-interface/controls/blazorwebview.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ The process to add a <xref:Microsoft.AspNetCore.Components.WebView.Maui.BlazorWe

## Access scoped services from native UI

<xref:Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView> has a `TryDispatchAsync` method that calls a specified `Action<ServiceProvider>` 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`:
<xref:Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView> has a `TryDispatchAsync` method that can call a specified `Action<ServiceProvider>` 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)
Expand All @@ -156,4 +156,51 @@ private async void MyMauiButtonHandler(object sender, EventArgs e)
}
```

## Diagnosing issues

<xref:Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView> 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 <xref:Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView> 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 <xref:Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView> 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
2 changes: 2 additions & 0 deletions docs/whats-new/TOC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
65 changes: 65 additions & 0 deletions docs/whats-new/dotnet-8.md
Original file line number Diff line number Diff line change
@@ -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:

- <xref:Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView> 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).

<!-- - The <xref:Microsoft.Maui.Controls.Maps.Map> control is a cross-platform view for displaying and annotating maps. The <xref:Microsoft.Maui.Controls.Maps.Map> control uses the native map control on each platform, and is provided by the [Microsoft.Maui.Controls.Maps NuGet package](https://www.nuget.org/packages/Microsoft.Maui.Controls.Maps/). For more information, see [Map](~/user-interface/controls/map.md).
- The <xref:Microsoft.Maui.Controls.Foldable.TwoPaneView> control is a container control for foldable devices that provides two views that size and position content in the available space, either side-by-side or top-to-bottom. This control is provided by the [Microsoft.Maui.Controls.Foldable NuGet package](https://www.nuget.org/packages/Microsoft.Maui.Controls.Foldable/).
- The <xref:Microsoft.Maui.Controls.PointerGestureRecognizer> class performs pointer gesture recognition and detects when the mouse pointer enters, exits, and moves within a view. For more information, see [Recognize a pointer gesture](~/fundamentals/gestures/pointer.md). .NET MAUI also defines a `PointerOver` visual state that can change the visual appearance of a view when it has a mouse cursor hovering over it. For more information, see [Visual states](~/user-interface/visual-states.md).
- The `Window` class defines additional properties and enables the window to be positioned and sized on desktop platforms. For more information, see [.NET MAUI Windows](~/fundamentals/windows.md).
- Tooltips can be displayed for a view, when the user rests a pointer on the view. For more information, see [Display tooltips](~/user-interface/tooltips.md).
- Context menus can be added to any control that derives from <xref:Microsoft.Maui.Controls.Element>, on Mac Catalyst and Windows. For more information, see [Display a context menu](~/user-interface/context-menu.md).
- Menu bars can contain separators, which are horizontal lines that separate items in the menu. For more information, see [Display a menu bar](~/user-interface/menu-bar.md).
- Additional .NET MAUI delegates are invoked in response to iOS lifecycle events being raised. For more information, see [App lifecycle](~/fundamentals/app-lifecycle.md#ios).
- The underlying native control for the <xref:Microsoft.Maui.Controls.WebView> on iOS and Mac Catalyst can be configured with a `WKWebViewConfiguration` object. For more information, see [Configure the native WebView on iOS and Mac Catalyst](~/user-interface/controls/webview.md#configure-the-native-webview-on-ios-and-mac-catalyst).
WebView config on iOS/Mac

In addition, `MessagingCenter` has been deprecated and replaced with `WeakReferenceMessenger` in the [CommunityToolkit.Mvvm NuGet package](https://www.nuget.org/packages/CommunityToolkit.Mvvm). -->

<!-- ## Performance

Performance is a key focus of .NET MAUI in .NET 7:

- On Android, startup performance has improved.
- On iOS, application size has been reduced.
- The rendering path for views has been optimized.
- Many issues have been addressed that impacted the smoothness of scrolling in a <xref:Microsoft.Maui.Controls.CollectionView>.

For more information, see [.NET 7 Performance Improvements in .NET MAUI](https://devblogs.microsoft.com/dotnet/dotnet-7-performance-improvements-in-dotnet-maui/). -->

<!-- ## Upgrading from .NET 7

To upgrade your projects from .NET 6 to .NET 7, open your *.csproj* file and change the Target Framework Monikers (TFMs) from 6 to 7. The following example shows the TFMs for a .NET 6 project:

```xml
<TargetFrameworks>net6.0-ios;net6.0-android;net6.0-maccatalyst;net6.0-tizen</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows')) and '$(MSBuildRuntimeType)' == 'Full'">$(TargetFrameworks);net6.0-windows10.0.19041</TargetFrameworks>
```

The following example shows the TFMs for a .NET 7 project:

```xml
<TargetFrameworks>net7.0-ios;net7.0-android;net7.0-maccatalyst;net7.0-tizen</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows')) and '$(MSBuildRuntimeType)' == 'Full'">$(TargetFrameworks);net7.0-windows10.0.19041</TargetFrameworks>
``` -->

<!-- ## See also

- [Release notes for .NET MAUI in .NET 7](https://github.com/dotnet/maui/releases/tag/7.0.49)
- [Release notes for .NET iOS, tvOS, macOS, and Mac Catalyst](https://github.com/xamarin/xamarin-macios/wiki/.NET-7-release-notes)
- [Release notes for .NET Android](https://github.com/xamarin/xamarin-android/releases/tag/33.0.4) -->