From 395675078c4306bf4b1d1ba2c4a5eab92d2cee84 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Tue, 9 Apr 2024 13:14:02 -0700 Subject: [PATCH] fix build warnings --- docs/core/whats-new/dotnet-9/libraries.md | 6 +++--- docs/core/whats-new/dotnet-9/sdk.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/core/whats-new/dotnet-9/libraries.md b/docs/core/whats-new/dotnet-9/libraries.md index 8e8ed5e3222f2..1972fd4678e2b 100644 --- a/docs/core/whats-new/dotnet-9/libraries.md +++ b/docs/core/whats-new/dotnet-9/libraries.md @@ -84,9 +84,9 @@ KMAC is available on Linux with OpenSSL 3.0 or later, and on Windows 11 Build 26 ## Reflection -In .NET Core versions and .NET 5-8, support for building an assembly and emitting reflection metadata for dynamically created types was limited to a runnable . The lack of support for *saving* an assembly was often a blocker for customers migrating from .NET Framework to .NET. .NET 9 adds a new type, , that you can use to save an emitted assembly. +In .NET Core versions and .NET 5-8, support for building an assembly and emitting reflection metadata for dynamically created types was limited to a runnable . The lack of support for *saving* an assembly was often a blocker for customers migrating from .NET Framework to .NET. .NET 9 adds a new type, `PersistedAssemblyBuilder` , that you can use to save an emitted assembly. -To create a `PersistedAssemblyBuilder` instance, call its constructor and pass the assembly name, the core assembly, `System.Private.CoreLib`, to reference base runtime types, and optional custom attributes. After you emit all members to the assembly, call the `PersistedAssemblyBuilder.Save(string assemblyFileName)` method to create an assembly with default settings. If you want to set the entry point or other options, you can call `PersistedAssemblyBuilder.GenerateMetadata(out BlobBuilder ilStream, out BlobBuilder mappedFieldData)` and use the metadata it returns to save the assembly. The following code shows an example of creating a persisted assembly and setting the entry point. +To create a `PersistedAssemblyBuilder` instance, call its constructor and pass the assembly name, the core assembly, `System.Private.CoreLib`, to reference base runtime types, and optional custom attributes. After you emit all members to the assembly, call the `PersistedAssemblyBuilder.Save(string assemblyFileName)` method to create an assembly with default settings. If you want to set the entry point or other options, you can call `PersistedAssemblyBuilder.GenerateMetadata(System.Reflection.Metadata.BlobBuilder,System.Reflection.Metadata.BlobBuilder)` and use the metadata it returns to save the assembly. The following code shows an example of creating a persisted assembly and setting the entry point. :::code language="csharp" source="../snippets/dotnet-9/csharp/Reflection.cs" id="SaveAssembly"::: @@ -121,4 +121,4 @@ The following code shows an example of calling the `double` and one of the new i ## `ActivatorUtilities.CreateInstance` constructor -The constructor resolution for `ActivatorUtilities.CreateInstance()` has changed in .NET 9. Previously, a constructor that was explicitly marked using the `[ActivatorUtilitiesConstructor]` attribute might not be called, depending on the ordering of constructors and the number of constructor parameters. The logic has changed in .NET 9 such that a constructor that has the attribute is always called. +The constructor resolution for has changed in .NET 9. Previously, a constructor that was explicitly marked using the attribute might not be called, depending on the ordering of constructors and the number of constructor parameters. The logic has changed in .NET 9 such that a constructor that has the attribute is always called. diff --git a/docs/core/whats-new/dotnet-9/sdk.md b/docs/core/whats-new/dotnet-9/sdk.md index c225fc8be1aab..5426c8b698bbf 100644 --- a/docs/core/whats-new/dotnet-9/sdk.md +++ b/docs/core/whats-new/dotnet-9/sdk.md @@ -21,7 +21,7 @@ In .NET 9, `dotnet test` is more fully integrated with MSBuild. Because MSBuild Test result reporting for [`dotnet test`](../../tools/dotnet-test.md) is now supported directly in the MSBuild terminal logger. You get more fully featured test reporting both *while* tests are running (displays the running test name) and *after* tests are completed (any test errors are rendered in a better way). -For more information about the terminal logger, see [dotnet build options](../tools/dotnet-build.md#options). +For more information about the terminal logger, see [dotnet build options](../../tools/dotnet-build.md#options). ## .NET tool roll-forward @@ -31,7 +31,7 @@ A new option for [`dotnet tool install`](../../tools/dotnet-tool-install.md) let ## Terminal logger usability -The terminal logger now summarizes the total count of failures and warnings at the end of a build. It also shows errors that contain newlines. (For more information about the terminal logger, see ['dotnet build' options](../../../tools/dotnet-build.md#options), specifically the `--tl` option.) +The terminal logger now summarizes the total count of failures and warnings at the end of a build. It also shows errors that contain newlines. (For more information about the terminal logger, see ['dotnet build' options](../../tools/dotnet-build.md#options), specifically the `--tl` option.) Consider the following project file that emits a warning when the project is built: