Skip to content

Commit

Permalink
Housekeeping updates for .NET 8 GA (dotnet#38017)
Browse files Browse the repository at this point in the history
  • Loading branch information
gewarren authored Nov 13, 2023
1 parent 82c511e commit 23a615f
Show file tree
Hide file tree
Showing 73 changed files with 260 additions and 356 deletions.
8 changes: 8 additions & 0 deletions .openpublishing.redirection.core.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@
"redirect_url": "/dotnet/core/compatibility/serialization/7.0/serializationformat-binary",
"redirect_document_id": true
},
{
"source_path_from_root": "/docs/core/compatibility/core-libraries/8.0/indexofanyvalues-renamed.md",
"redirect_url": "/dotnet/core/compatibility/serialization/8.0"
},
{
"source_path_from_root": "/docs/core/compatibility/core-libraries/8.0/optimizeforreading-arg.md",
"redirect_url": "/dotnet/core/compatibility/serialization/8.0"
},
{
"source_path_from_root": "/docs/core/compatibility/extensions/6.0/bind-single-elements-to-array.md",
"redirect_url": "/dotnet/core/compatibility/6.0"
Expand Down
6 changes: 3 additions & 3 deletions api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ description: Explore Microsoft's comprehensive .NET API browser. Your ultimate r
layout: ApiBrowserPage
hide_bc: true
title: .NET API browser
quickFilterColumn1: net-7.0,netframework-4.8,netstandard-2.1
quickFilterColumn2: aspnetcore-7.0,efcore-7.0,net-maui-7.0
quickFilterColumn1: net-8.0,netframework-4.8,netstandard-2.1
quickFilterColumn2: aspnetcore-8.0,efcore-8.0,net-maui-8.0
quickFilterColumn3: azure-dotnet,ml-dotnet,spark-dotnet
ms.topic: landing-page
ms.custom: "updateeachrelease"
ms.date: 11/18/2022
ms.date: 11/14/2023
---
# .NET API browser

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ In production environments like Kubernetes, it's important to monitor applicatio

## Logging in ASP.NET Core gRPC

ASP.NET Core provides built-in support for logging, in the form of [Microsoft.Extensions.Logging](https://www.nuget.org/packages/Microsoft.Extensions.Logging) NuGet package. The core parts of this library are included with the Web SDK, so there's no need to install it manually. By default, log messages are written to the standard output (the "console") and to any attached debugger. To write logs to persistent external data stores, you might need to import [optional logging sink packages](/aspnet/core/fundamentals/logging/?view=aspnetcore-3.0#third-party-logging-providers&preserve-view=false).
ASP.NET Core provides built-in support for logging, in the form of [Microsoft.Extensions.Logging](https://www.nuget.org/packages/Microsoft.Extensions.Logging) NuGet package. The core parts of this library are included with the Web SDK, so there's no need to install it manually. By default, log messages are written to the standard output (the "console") and to any attached debugger. To write logs to persistent external data stores, you might need to import [optional logging sink packages](/aspnet/core/fundamentals/logging/#third-party-logging-providers).

The ASP.NET Core gRPC framework writes detailed diagnostic logging messages to this logging framework, so they can be processed and stored along with your application's own messages.

Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/maui/unit-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ multi-platform apps experience problems similar to both desktop and web-based ap

A unit test takes a small unit of the app, typically a method, isolates it from the remainder of the code, and verifies that it behaves as expected. Its goal is to check that each unit of functionality performs as expected, so errors don't propagate throughout the app. Detecting a bug where it occurs is more efficient that observing the effect of a bug indirectly at a secondary point of failure.

Unit testing has the most significant effect on code quality when it's an integral part of the software development workflow. Unit tests can act as design documentation and functional specifications for an application. As soon as a method has been written, unit tests should be written that verify the method's behavior in response to standard, boundary, and incorrect input data cases and check any explicit or implicit assumptions made by the code. Alternatively, with test-driven development, unit tests are written before the code. For more information on test-driven development and how to implement it, see [Walkthrough: Test-driven development using Test Explorer.](/visualstudio/test/quick-start-test-driven-development-with-test-explorer?view=vs-2022&preserve-view=true)
Unit testing has the most significant effect on code quality when it's an integral part of the software development workflow. Unit tests can act as design documentation and functional specifications for an application. As soon as a method has been written, unit tests should be written that verify the method's behavior in response to standard, boundary, and incorrect input data cases and check any explicit or implicit assumptions made by the code. Alternatively, with test-driven development, unit tests are written before the code. For more information on test-driven development and how to implement it, see [Walkthrough: Test-driven development using Test Explorer.](/visualstudio/test/quick-start-test-driven-development-with-test-explorer)

> [!NOTE]
> Unit tests are very effective against regression. That is, functionality that used to work, but has been disturbed by a faulty update.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Without using `IHostedService`, you could always start a background thread to ru

## The IHostedService interface

When you register an `IHostedService`, .NET will call the `StartAsync()` and `StopAsync()` methods of your `IHostedService` type during application start and stop respectively. For more details, refer [IHostedService interface](/aspnet/core/fundamentals/host/hosted-services?tabs=visual-studio&view=aspnetcore-3.1&preserve-view=false#ihostedservice-interface)
When you register an `IHostedService`, .NET calls the `StartAsync()` and `StopAsync()` methods of your `IHostedService` type during application start and stop respectively. For more details, see [IHostedService interface](/aspnet/core/fundamentals/host/hosted-services#ihostedservice-interface).

As you can imagine, you can create multiple implementations of IHostedService and register each of them in _Program.cs_, as shown previously. All those hosted services will be started and stopped along with the application/microservice.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Figure 5-1 shows how the ASP.NET Core 2.1 *api* app appears in IIS Manager as a

**Figure 5-1**. .NET Framework Site with .NET Core app in IIS.

The *DotNetMvcApp* site is hosted as an MVC 5 app running on .NET Framework 4.7.2. It has its own IIS app pool configured in integrated mode and running .NET CLR version 4.0.30319. The *api* app is an ASP.NET Core app running on .NET Framework 4.6.1 (`net461`). It was added to the *DotNetMvcApp* as a new IIS app and configured to use its own Application Pool. Its Application Pool is also running in integrated mode but is configured with a .NET CLR version of **No Managed Code** since it will be executed using the [ASP.NET Core Module](/aspnet/core/host-and-deploy/aspnet-core-module?preserve-view=true&view=aspnetcore-2.1). The version of the ASP.NET Core app is just an example. It could also be configured to run on NET 5+. Though at that point, it would no longer be able to target .NET Framework libraries (see [Choose the Right .NET Core Version](choose-net-core-version.md))
The *DotNetMvcApp* site is hosted as an MVC 5 app running on .NET Framework 4.7.2. It has its own IIS app pool configured in integrated mode and running .NET CLR version 4.0.30319. The *api* app is an ASP.NET Core app running on .NET Framework 4.6.1 (`net461`). It was added to the *DotNetMvcApp* as a new IIS app and configured to use its own Application Pool. Its Application Pool is also running in integrated mode but is configured with a .NET CLR version of **No Managed Code** since it will be executed using the [ASP.NET Core Module](/aspnet/core/host-and-deploy/aspnet-core-module). The version of the ASP.NET Core app is just an example. It could also be configured to run on NET 5+. Though at that point, it would no longer be able to target .NET Framework libraries (see [Choose the Right .NET Core Version](choose-net-core-version.md))

Configured in this manner, the only change that must be made in order for the ASP.NET Core app's APIs to be routed properly is to change its default route template from `[Route("[api/controller]")]` to `[Route("[controller]")]`.

Expand All @@ -68,7 +68,7 @@ A common approach to porting large apps from .NET Framework to ASP.NET Core is t
- [Host ASP.NET Core on Windows with IIS](/aspnet/core/host-and-deploy/iis/)
- [URL Rewrite module and Application Request Routing](/iis/extensions/url-rewrite-module/reverse-proxy-with-url-rewrite-v2-and-application-request-routing)
- [URL Rewrite](https://www.iis.net/downloads/microsoft/url-rewrite)
- [ASP.NET Core Module](/aspnet/core/host-and-deploy/aspnet-core-module?preserve-view=true&view=aspnetcore-2.1)
- [ASP.NET Core Module](/aspnet/core/host-and-deploy/aspnet-core-module)
- [Share authentication cookies among ASP.NET apps](/aspnet/core/security/cookie-sharing)
- [Samples used in this section](https://github.com/ardalis/MigrateDotNetWithIIS)
- [Incremental ASP.NET to ASP.NET Core Migration](https://devblogs.microsoft.com/dotnet/incremental-asp-net-to-asp-net-core-migration/)
Expand Down
4 changes: 2 additions & 2 deletions docs/azure/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ highlightedContent:
url: /azure/azure-functions/functions-create-your-first-function-visual-studio
- itemType: tutorial
title: ASP.NET Core and Docker
url: /visualstudio/containers/container-tools?view=vs-2019
url: /visualstudio/containers/container-tools
- itemType: deploy
title: Deploy a .NET app with Azure DevOps
url: /azure/devops/pipelines/ecosystems/dotnet-core?view=azure-devops
Expand Down Expand Up @@ -86,7 +86,7 @@ conceptualContent:
url: /azure/azure-app-configuration/use-feature-flags-dotnet-core
- itemType: how-to-guide
text: Deploy a .NET Core app to Azure Container Registry
url: /visualstudio/containers/hosting-web-apps-in-docker?view=vs-2019
url: /visualstudio/containers/hosting-web-apps-in-docker
- title: Create mobile apps
links:
- itemType: learn
Expand Down
2 changes: 0 additions & 2 deletions docs/core/compatibility/8.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,10 @@ If you're migrating an app to .NET 8, the breaking changes listed here might aff
| [GC.GetGeneration might return Int32.MaxValue](core-libraries/8.0/getgeneration-return-value.md) | Behavioral change |
| [GetFolderPath behavior on Unix](core-libraries/8.0/getfolderpath-unix.md) | Behavioral change |
| [GetSystemVersion no longer returns ImageRuntimeVersion](core-libraries/8.0/getsystemversion.md) | Behavioral change |
| [IndexOfAnyValues renamed to SearchValues](core-libraries/8.0/indexofanyvalues-renamed.md) | Source/binary incompatible |
| [ITypeDescriptorContext nullable annotations](core-libraries/8.0/itypedescriptorcontext-props.md) | Source incompatible |
| [Legacy Console.ReadKey removed](core-libraries/8.0/console-readkey-legacy.md) | Behavioral change |
| [Method builders generate parameters with HasDefaultValue set to false](core-libraries/8.0/parameterinfo-hasdefaultvalue.md) | Behavioral change |
| [ProcessStartInfo.WindowsStyle honored when UseShellExecute is false](core-libraries/8.0/processstartinfo-windowstyle.md) | Behavioral change |
| [Removed overloads of ToFrozenDictionary/ToFrozenSet](core-libraries/8.0/optimizeforreading-arg.md) | Source/binary incompatible |
| [RuntimeIdentifier returns platform for which runtime was built](core-libraries/8.0/runtimeidentifier.md) | Behavioral change |

## Cryptography
Expand Down
2 changes: 1 addition & 1 deletion docs/core/compatibility/aspnet-core/8.0/trimmode-full.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Previously, `TrimMode=partial` was set by default for all projects that targeted

## New behavior

Starting in .NET 8, all the assemblies in the app are trimmed, by default. Apps that previously worked with `PublishTrimmed=true` and `TrimMode=partial` might not work in .NET 8 Preview 7 and later versions. However, only apps with trim warnings are affected. If your app has no trim warnings, the change in behavior shouldn't cause any adverse effects.
Starting in .NET 8, all the assemblies in the app are trimmed, by default. Apps that previously worked with `PublishTrimmed=true` and `TrimMode=partial` might not work in .NET 8 and later versions. However, only apps with trim warnings are affected. If your app has no trim warnings, the change in behavior shouldn't cause any adverse effects.

## Type of breaking change

Expand Down
3 changes: 0 additions & 3 deletions docs/core/compatibility/containers/8.0/multi-platform-tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ Update your tag usage to indicate which Windows version you're targeting. Instea

Select an image name based on whether you're using Nano Server or Windows Server Core and which version of that OS. You can find a full list of all supported tags on .NET's [Docker Hub page](https://hub.docker.com/_/microsoft-dotnet).

> [!NOTE]
> In the example image names, the `8.0` tag prefix is used, which is the value that will exist once .NET 8 ships. While .NET 8 is still in preview, you can replace `8.0` with `8.0-preview`.
## Affected APIs

None.
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ms.date: 06/06/2023
---
# SafeHandle types must have public constructor

Historically, passing <xref:System.Runtime.InteropServices.SafeHandle>-derived types to P/Invokes and COM methods has implicitly required a parameterless constructor of any visibility when a `SafeHandle`-derived type is passed as a `ref` or `out` parameter or a return type. Source-generated interop in .NET 7 and earlier .NET 8 preview versions allowed this behavior to enable easier migration from <xref:System.Runtime.InteropServices.DllImportAttribute>-based P/Invokes. At the same time, we updated the [SafeHandle documentation](/dotnet/api/system.runtime.interopservices.safehandle#notes-to-implementers) to tell implementers to provide a `public` parameterless constructor in their derived type. This breaking change makes that recommendation a requirement for source-generated marshalling.
Historically, passing <xref:System.Runtime.InteropServices.SafeHandle>-derived types to P/Invokes and COM methods has implicitly required a parameterless constructor of any visibility when a `SafeHandle`-derived type is passed as a `ref` or `out` parameter or a return type. Source-generated interop in .NET 7 allowed this behavior to enable easier migration from <xref:System.Runtime.InteropServices.DllImportAttribute>-based P/Invokes. At the same time, we updated the [SafeHandle documentation](/dotnet/api/system.runtime.interopservices.safehandle#notes-to-implementers) to tell implementers to provide a `public` parameterless constructor in their derived type. This breaking change makes that recommendation a requirement for source-generated marshalling.

## Previous behavior

Expand Down
Loading

0 comments on commit 23a615f

Please sign in to comment.