diff --git a/docs/core/whats-new/dotnet-9/libraries.md b/docs/core/whats-new/dotnet-9/libraries.md index dd033c08355f3..52714e88a0b77 100644 --- a/docs/core/whats-new/dotnet-9/libraries.md +++ b/docs/core/whats-new/dotnet-9/libraries.md @@ -88,7 +88,7 @@ KMAC is available on Linux with OpenSSL 3.0 or later, and on Windows 11 Build 26 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. -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 method to create an assembly with default settings. If you want to set the entry point or other options, you can call 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 method to create an assembly with default settings. If you want to set the entry point or other options, you can call 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"::: @@ -109,11 +109,3 @@ The following code shows an example of calling the `double` and one of the new i ### `ActivatorUtilities.CreateInstance` constructor 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. - -## Diagnostics - -### New Activity.AddLink method - -Previously, you could only link a tracing to other tracing contexts when you [created the `Activity`](xref:System.Diagnostics.ActivitySource.CreateActivity(System.String,System.Diagnostics.ActivityKind,System.Diagnostics.ActivityContext,System.Collections.Generic.IEnumerable{System.Collections.Generic.KeyValuePair{System.String,System.Object}},System.Collections.Generic.IEnumerable{System.Diagnostics.ActivityLink},System.Diagnostics.ActivityIdFormat)?displayProperty=nameWithType). New in .NET 9, the API lets you link an `Activity` object to other tracing contexts after it's created. This change aligns with the [OpenTelemetry specifications](https://github.com/open-telemetry/opentelemetry-specification/blob/6360b49d20ae451b28f7ba0be168ed9a799ac9e1/specification/trace/api.md?plain=1#L804) as well. - -:::code language="csharp" source="../snippets/dotnet-9/csharp/Diagnostics.cs" id="AddLink"::: diff --git a/docs/core/whats-new/dotnet-9/overview.md b/docs/core/whats-new/dotnet-9/overview.md index 27d616396b956..3ed03afbd317a 100644 --- a/docs/core/whats-new/dotnet-9/overview.md +++ b/docs/core/whats-new/dotnet-9/overview.md @@ -41,8 +41,6 @@ In the reflection area, the new class includes new `From*` methods that let you create a `TimeSpan` object from an `int` (instead of a `double`). These methods help to avoid errors caused by inherent imprecision in floating-point calculations. -In diagnostics, the new API lets you link an object to other tracing contexts after it's created. Previously, you could only link a tracing `Activity` to other tracing contexts when you created it. - For more information, see [What's new in the .NET 9 libraries](libraries.md). ## .NET SDK