From fad43fd09168885133d0db422f1e2bbaee8d8b60 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Thu, 5 Oct 2023 16:29:42 -0700 Subject: [PATCH 1/7] first updates for rc 2 --- docs/core/whats-new/dotnet-8.md | 71 ++++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 2 deletions(-) diff --git a/docs/core/whats-new/dotnet-8.md b/docs/core/whats-new/dotnet-8.md index 1476f37810bb5..903dfcd3a041d 100644 --- a/docs/core/whats-new/dotnet-8.md +++ b/docs/core/whats-new/dotnet-8.md @@ -2,7 +2,7 @@ title: What's new in .NET 8 description: Learn about the new .NET features introduced in .NET 8. titleSuffix: "" -ms.date: 09/26/2023 +ms.date: 10/05/2023 ms.topic: overview ms.author: gewarren author: gewarren @@ -11,7 +11,7 @@ author: gewarren .NET 8 is the successor to [.NET 7](dotnet-7.md). It will be [supported for three years](https://dotnet.microsoft.com/platform/support/policy/dotnet-core) as a long-term support (LTS) release. You can [download .NET 8 here](https://dotnet.microsoft.com/download/dotnet). -This article has been updated for .NET 8 release candidate (RC) 1. +This article has been updated for .NET 8 release candidate (RC) 2. > [!IMPORTANT] > @@ -649,6 +649,7 @@ This section contains the following subtopics: - [Extensions metrics](#extensions-metrics) - [Hosted lifecycle services](#hosted-lifecycle-services) - [Keyed DI services](#keyed-di-services) +- [System.Numerics.Tensors.TensorPrimitives](#systemnumericstensorstensorprimitives) ### Keyed DI services @@ -865,6 +866,16 @@ Assert.Empty(collector.LastMeasurement.Tags); Assert.Equal(now, collector.LastMeasurement.Timestamp); ``` +### System.Numerics.Tensors.TensorPrimitives + +The [System.Numerics.Tensors.TensorPrimitives](https://www.nuget.org/packages/System.Numerics.Tensors.TensorPrimitives) NuGet package adds built-in .NET support for tensor operations. The tensor primitives are the next step in the evolution of numerics for AI in .NET. They build on top of [hardware intrinsics](xref:System.Runtime.Intrinsics) and [generic math](../../standard/generics/math.md) to optimize data-intensive workloads like those of AI and machine learning. + +AI workloads like semantic search and retrieval-augmented generation (RAG) extend the natural language capabilities of large language models such as ChatGPT by augmenting prompts with relevant data. For these workloads, operations on vectors—like *cosine similarity* to find the most relevant data to answer a question—are crucial. The System.Numerics.Tensors.TensorPrimitives package provides APIs for vector operations, meaning you don't need to take an external dependency or write your own implementation. + +This package replaces the [System.Numerics.Tensors package](https://www.nuget.org/packages/System.Numerics.Tensors). + +For more information, see the [Announcing .NET 8 RC 2 blog post](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-rc2/). + ## Garbage collection .NET 8 adds a capability to adjust the memory limit on the fly. This is useful in cloud-service scenarios, where demand comes and goes. To be cost-effective, services should scale up and down on resource consumption as the demand fluctuates. When a service detects a decrease in demand, it can scale down resource consumption by reducing its memory limit. Previously, this would fail because the garbage collector (GC) was unaware of the change and might allocate more memory than the new limit. With this change, you can call the `_RefreshMemoryLimit` API to update the GC with the new memory limit. @@ -1107,6 +1118,7 @@ Physical promotion removes these limitations, which fixes a number of long-stand This section contains the following subtopics: +- [CLI-based project evaluation](#cli-based-project-evaluation) - [Terminal build output](#terminal-build-output) - [Simplified output paths](#simplified-output-paths) - ['dotnet workload clean' command](#dotnet-workload-clean-command) @@ -1115,6 +1127,46 @@ This section contains the following subtopics: - [Source Link](#source-link) - [Source-build SDK](#source-build-sdk) +### CLI-based project evaluation + +MSBuild includes a new feature that makes it easier to incorporate data from MSBuild into your scripts or tools. The following new flags are available for CLI commands such as [dotnet publish](../tools/dotnet-publish.md) to obtain data for use in CI pipelines and elsewhere. + +| Flag | Description | +|---------|---------| +| `--getProperty:` | Retrieves the MSBuild property with the specified name. | +| `--getItem:` | Retrieves MSBuild items of the specified type. | +| `--getTargetResults:` | Retrieves the outputs from running the specified target. | + +Values are written to the standard output. Multiple or complex values are output as JSON, as shown in the following examples. + +```dotnetcli +>dotnet publish --getProperty:OutputPath +bin\Release\net8.0\ +``` + +```dotnetcli +> dotnet publish -p PublishProfile=DefaultContainer --getProperty:GeneratedContainerDigest --getProperty:GeneratedContainerConfiguration +{ + "Properties": { + "GeneratedContainerDigest": "sha256:ef880a503bbabcb84bbb6a1aa9b41b36dc1ba08352e7cd91c0993646675174c4", + "GeneratedContainerConfiguration": "{\u0022config\u0022:{\u0022ExposedPorts\u0022:{\u00228080/tcp\u0022:{}},\u0022Labels\u0022...}}" + } +} +``` + +```dotnetcli +>dotnet publish -p PublishProfile=DefaultContainer --getItem:ContainerImageTags +{ + "Items": { + "ContainerImageTags": [ + { + "Identity": "latest", + ... + ] + } +} +``` + ### Terminal build output `dotnet build` has a new option to produce more modernized build output. This *terminal logger* output groups errors with the project they came from, better differentiates the different target frameworks for multi-targeted projects, and provides real-time information about what the build is doing. To opt into the new output, use the `--tl` option. For more information about this option, see [dotnet build options](../tools/dotnet-build.md#options). @@ -1317,6 +1369,7 @@ Composite images are available for the Alpine Linux, Jammy Chiseled, and Mariner - [Performance and compatibility](#performance-and-compatibility) - [Authentication](#authentication) +- [Publish to tar.gz archive](#publish-to-targz-archive) #### Performance and compatibility @@ -1335,6 +1388,18 @@ These improvements also mean that more registries are supported: Harbor, Artifac For more information containerizing .NET apps, see [Containerize a .NET app with dotnet publish](../docker/publish-as-container.md). +#### Publish to tar.gz archive + +Starting in .NET 8, you can create a container directly as a *tar.gz* archive. This feature is useful if your workflow isn't straightforward and requires that you, for example, run a scanning tool over your images before pushing them. Once the archive is created, you can move it, scan it, or load it into a local Docker toolchain. + +To publish to an archive, add the `ContainerArchiveOutputPath` property to your `dotnet publish` command, for example: + +```dotnetcli +dotnet publish -p PublishProfile=DefaultContainer -p ContainerArchiveOutputPath=./images/sdk-container-demo.tar.gz +``` + +You can specify either a folder name or a path with a specific file name. + ## Source-generated COM interop .NET 8 includes a new source generator that supports interoperating with COM interfaces. You can use the to mark an interface as a COM interface for the source generator. The source generator will then generate code to enable calling from C# code to unmanaged code. It also generates code to enable calling from unmanaged code into C#. This source generator integrates with , and you can use types with the as parameters and return types in `LibraryImport`-attributed methods. @@ -1478,6 +1543,7 @@ You can opt out of verification by setting the environment variable `DOTNET_NUGE ### .NET blog +- [Announcing .NET 8 RC 2](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-rc2/) - [Announcing .NET 8 RC 1](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-rc1/) - [Announcing .NET 8 Preview 7](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-preview-7/) - [Announcing .NET 8 Preview 6](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-preview-6/) @@ -1486,6 +1552,7 @@ You can opt out of verification by setting the environment variable `DOTNET_NUGE - [Announcing .NET 8 Preview 3](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-preview-3/) - [Announcing .NET 8 Preview 2](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-preview-2/) - [Announcing .NET 8 Preview 1](https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-preview-1/) +- [ASP.NET Core updates in .NET 8 RC 2](https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-rc-2/) - [ASP.NET Core updates in .NET 8 RC 1](https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-rc-1/) - [ASP.NET Core updates in .NET 8 Preview 7](https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-preview-7/) - [ASP.NET Core updates in .NET 8 Preview 6](https://devblogs.microsoft.com/dotnet/asp-net-core-updates-in-dotnet-8-preview-6/) From fec7b6a302a3ba29a8d55f382db3516a7a19e961 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Thu, 5 Oct 2023 16:35:57 -0700 Subject: [PATCH 2/7] fix hard tab --- docs/core/whats-new/dotnet-8.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/whats-new/dotnet-8.md b/docs/core/whats-new/dotnet-8.md index 903dfcd3a041d..8e5d45d0b92b1 100644 --- a/docs/core/whats-new/dotnet-8.md +++ b/docs/core/whats-new/dotnet-8.md @@ -1161,7 +1161,7 @@ bin\Release\net8.0\ "ContainerImageTags": [ { "Identity": "latest", - ... + ... ] } } From 43e69d1693cb37b46e40dd4ebaf17814ce5493b5 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Tue, 10 Oct 2023 14:40:12 -0700 Subject: [PATCH 3/7] Update docs/core/whats-new/dotnet-8.md Co-authored-by: David Pine --- docs/core/whats-new/dotnet-8.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/core/whats-new/dotnet-8.md b/docs/core/whats-new/dotnet-8.md index 8e5d45d0b92b1..dd0200e713e55 100644 --- a/docs/core/whats-new/dotnet-8.md +++ b/docs/core/whats-new/dotnet-8.md @@ -1395,7 +1395,9 @@ Starting in .NET 8, you can create a container directly as a *tar.gz* archive. T To publish to an archive, add the `ContainerArchiveOutputPath` property to your `dotnet publish` command, for example: ```dotnetcli -dotnet publish -p PublishProfile=DefaultContainer -p ContainerArchiveOutputPath=./images/sdk-container-demo.tar.gz +dotnet publish \ + -p PublishProfile=DefaultContainer \ + -p ContainerArchiveOutputPath=./images/sdk-container-demo.tar.gz ``` You can specify either a folder name or a path with a specific file name. From f20dd4058818c6f08fc4e95057ea90496aa89a71 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Tue, 10 Oct 2023 15:56:54 -0700 Subject: [PATCH 4/7] update --- docs/core/whats-new/dotnet-8.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/whats-new/dotnet-8.md b/docs/core/whats-new/dotnet-8.md index 8e5d45d0b92b1..4230a9bf17a1a 100644 --- a/docs/core/whats-new/dotnet-8.md +++ b/docs/core/whats-new/dotnet-8.md @@ -868,7 +868,7 @@ Assert.Equal(now, collector.LastMeasurement.Timestamp); ### System.Numerics.Tensors.TensorPrimitives -The [System.Numerics.Tensors.TensorPrimitives](https://www.nuget.org/packages/System.Numerics.Tensors.TensorPrimitives) NuGet package adds built-in .NET support for tensor operations. The tensor primitives are the next step in the evolution of numerics for AI in .NET. They build on top of [hardware intrinsics](xref:System.Runtime.Intrinsics) and [generic math](../../standard/generics/math.md) to optimize data-intensive workloads like those of AI and machine learning. +The [System.Numerics.Tensors.TensorPrimitives](https://www.nuget.org/packages/System.Numerics.Tensors.TensorPrimitives) NuGet package adds built-in .NET support for tensor operations. The tensor primitives optimize data-intensive workloads like those of AI and machine learning. AI workloads like semantic search and retrieval-augmented generation (RAG) extend the natural language capabilities of large language models such as ChatGPT by augmenting prompts with relevant data. For these workloads, operations on vectors—like *cosine similarity* to find the most relevant data to answer a question—are crucial. The System.Numerics.Tensors.TensorPrimitives package provides APIs for vector operations, meaning you don't need to take an external dependency or write your own implementation. From 7ccfc3018dfb49dba4ecc621c3aa0cd741e788b0 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Tue, 10 Oct 2023 16:25:10 -0700 Subject: [PATCH 5/7] Update docs/core/whats-new/dotnet-8.md --- docs/core/whats-new/dotnet-8.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/whats-new/dotnet-8.md b/docs/core/whats-new/dotnet-8.md index 10822d28c6744..a5f32ed76f3eb 100644 --- a/docs/core/whats-new/dotnet-8.md +++ b/docs/core/whats-new/dotnet-8.md @@ -868,7 +868,7 @@ Assert.Equal(now, collector.LastMeasurement.Timestamp); ### System.Numerics.Tensors.TensorPrimitives -The [System.Numerics.Tensors.TensorPrimitives](https://www.nuget.org/packages/System.Numerics.Tensors.TensorPrimitives) NuGet package adds built-in .NET support for tensor operations. The tensor primitives optimize data-intensive workloads like those of AI and machine learning. +The updated [System.Numerics.Tensors](https://www.nuget.org/packages/System.Numerics.Tensors) NuGet package includes APIs in the new namespace that add support for tensor operations. The tensor primitives optimize data-intensive workloads like those of AI and machine learning. AI workloads like semantic search and retrieval-augmented generation (RAG) extend the natural language capabilities of large language models such as ChatGPT by augmenting prompts with relevant data. For these workloads, operations on vectors—like *cosine similarity* to find the most relevant data to answer a question—are crucial. The System.Numerics.Tensors.TensorPrimitives package provides APIs for vector operations, meaning you don't need to take an external dependency or write your own implementation. From 4d401d1aabbd9da1d385830f7440c6d1a348e528 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 11 Oct 2023 21:44:10 -0700 Subject: [PATCH 6/7] fix warnings --- docs/core/diagnostics/metrics-instrumentation.md | 3 +-- docs/core/whats-new/dotnet-8.md | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/core/diagnostics/metrics-instrumentation.md b/docs/core/diagnostics/metrics-instrumentation.md index 14bd9e90d5893..52906c64abc2b 100644 --- a/docs/core/diagnostics/metrics-instrumentation.md +++ b/docs/core/diagnostics/metrics-instrumentation.md @@ -534,8 +534,7 @@ Press p to pause, r to resume, q to quit. ## Test custom metrics -Its possible to test any custom metrics you add using . This type makes it easy to record the measurements -from specific instruments and assert the values were correct. +Its possible to test any custom metrics you add using . This type makes it easy to record the measurements from specific instruments and assert the values were correct. ### Test with dependency injection diff --git a/docs/core/whats-new/dotnet-8.md b/docs/core/whats-new/dotnet-8.md index 10822d28c6744..af8a56e5d7c8f 100644 --- a/docs/core/whats-new/dotnet-8.md +++ b/docs/core/whats-new/dotnet-8.md @@ -838,7 +838,7 @@ Meter meter = meterFactory.Create(options); #### MetricCollector\ class -The new class lets you record metric measurements along with timestamps. Additionally, the class offers the flexibility to use a time provider of your choice for accurate timestamp generation. +The new class lets you record metric measurements along with timestamps. Additionally, the class offers the flexibility to use a time provider of your choice for accurate timestamp generation. ```csharp const string CounterName = "MyCounter"; From 3247cbbc0ec771b8c70049a0586f3edb43acfc1f Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Wed, 11 Oct 2023 21:45:32 -0700 Subject: [PATCH 7/7] update date --- docs/core/diagnostics/metrics-instrumentation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/core/diagnostics/metrics-instrumentation.md b/docs/core/diagnostics/metrics-instrumentation.md index 52906c64abc2b..bfa0a13d69091 100644 --- a/docs/core/diagnostics/metrics-instrumentation.md +++ b/docs/core/diagnostics/metrics-instrumentation.md @@ -2,10 +2,10 @@ title: Creating Metrics description: How to add new metrics to a .NET library or application ms.topic: tutorial -ms.date: 11/04/2021 +ms.date: 10/11/2023 --- -# Creating Metrics +# Creating metrics **This article applies to: ✔️** .NET Core 6 and later versions **✔️** .NET Framework 4.6.1 and later versions