![]() |
VOOZH | about |
dotnet add package Microsoft.Extensions.Primitives --version 10.0.9
NuGet\Install-Package Microsoft.Extensions.Primitives -Version 10.0.9
<PackageReference Include="Microsoft.Extensions.Primitives" Version="10.0.9" />
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="10.0.9" />Directory.Packages.props
<PackageReference Include="Microsoft.Extensions.Primitives" />Project file
paket add Microsoft.Extensions.Primitives --version 10.0.9
#r "nuget: Microsoft.Extensions.Primitives, 10.0.9"
#:package Microsoft.Extensions.Primitives@10.0.9
#addin nuget:?package=Microsoft.Extensions.Primitives&version=10.0.9Install as a Cake Addin
#tool nuget:?package=Microsoft.Extensions.Primitives&version=10.0.9Install as a Cake Tool
Microsoft.Extensions.Primitives contains isolated types that are used in many places within console or ASP.NET Core applications using framework extensions.
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Primitives;
using System;
class Program
{
static void Main(string[] args)
{
// Create a configuration builder
var configurationBuilder = new ConfigurationBuilder()
.SetBasePath(Environment.CurrentDirectory)
// appsettings.json expected to have the following contents:
// {
// "SomeKey": "SomeValue"
// }
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
// Build the configuration
IConfiguration configuration = configurationBuilder.Build();
// Create a change token for the configuration
IChangeToken changeToken = configuration.GetReloadToken();
// Attach a change callback
IDisposable changeTokenRegistration = changeToken.RegisterChangeCallback(state =>
{
Console.WriteLine("Configuration changed!");
IConfigurationRoot root = (IConfigurationRoot)state;
var someValue = root["SomeKey"]; // Access the updated configuration value
Console.WriteLine($"New value of SomeKey: {someValue}");
}, configuration);
// go and update the value of the key SomeKey in appsettings.json.
// The change callback will be invoked when the file is saved.
Console.WriteLine("Listening for configuration changes. Press any key to exit.");
Console.ReadKey();
// Clean up the change token registration when no longer needed
changeTokenRegistration.Dispose();
}
}
using System;
using Microsoft.Extensions.Primitives;
namespace StringValuesSample
{
class Program
{
static void Main(string[] args)
{
// Create a StringValues object from a single string or an array of strings
StringValues single = "Hello";
StringValues multiple = new string[] { "Hello", "World" };
// Use the implicit conversion to string or the ToString method to get the values
Console.WriteLine($"Single: {single}"); // Single: Hello
Console.WriteLine($"Multiple: {multiple}"); // Multiple: Hello,World
// Use the indexer, the Count property, and the IsNullOrEmpty method to access the values
Console.WriteLine($"Multiple[1]: {multiple[1]}"); // Multiple[1]: World
Console.WriteLine($"Single.Count: {single.Count}"); // Single.Count: 1
Console.WriteLine($"Multiple.IsNullOrEmpty: {StringValues.IsNullOrEmpty(multiple)}"); // Multiple.IsNullOrEmpty: False
// Use the Equals method or the == operator to compare two StringValues objects
Console.WriteLine($"single == \"Hello\": {single == "Hello"}"); // single == "Hello": True
Console.WriteLine($"multiple == \"Hello\": {multiple == "Hello"}"); // multiple == "Hello": False
}
}
}
The main types provided by this library are:
IChangeTokenStringValuesStringSegmentMicrosoft.Extensions.Primitives is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Microsoft.Extensions.Primitives:
| Package | Downloads |
|---|---|
|
Microsoft.Extensions.Options
Provides a strongly typed way of specifying and accessing settings using dependency injection. |
|
|
Microsoft.Extensions.Configuration.Abstractions
Provides abstractions of key-value pair based configuration. Interfaces defined in this package are implemented by classes in Microsoft.Extensions.Configuration and other configuration packages. |
|
|
Microsoft.Extensions.Configuration
Implementation of key-value pair based configuration for Microsoft.Extensions.Configuration. Includes the memory configuration provider. |
|
|
Microsoft.Extensions.FileProviders.Abstractions
Abstractions of files and directories. Commonly Used Types: Microsoft.Extensions.FileProviders.IDirectoryContents Microsoft.Extensions.FileProviders.IFileInfo Microsoft.Extensions.FileProviders.IFileProvider |
|
|
Microsoft.Extensions.FileProviders.Physical
File provider for physical files for Microsoft.Extensions.FileProviders. |
Showing the top 20 popular GitHub repositories that depend on Microsoft.Extensions.Primitives:
| Repository | Stars |
|---|---|
|
dotnet/roslyn
The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
|
|
|
dotnet/AspNetCore.Docs
Documentation for ASP.NET Core
|
|
|
chocolatey/choco
Chocolatey - the package manager for Windows
|
|
|
JeffreySu/WeiXinMPSDK
微信全平台 .NET SDK, Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 10.0。已支持微信公众号、小程序、小游戏、微信支付、企业微信/企业号、开放平台、JSSDK、微信周边等全平台。 WeChat SDK for C#.
|
|
|
microsoft/ailab
Experience, Learn and Code the latest breakthrough innovations with Microsoft AI
|
|
|
microsoft/aspire
Aspire is the tool for code-first, extensible, observable dev and deploy.
|
|
|
Azure/azure-sdk-for-net
This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
|
|
|
FastEndpoints/FastEndpoints
A light-weight REST API development framework for ASP.NET 8 and newer.
|
|
|
ChilliCream/graphql-platform
Welcome to the home of the Hot Chocolate GraphQL server for .NET, the Strawberry Shake GraphQL client for .NET and Nitro the awesome Monaco based GraphQL IDE.
|
|
|
aspnet/Mvc
[Archived] ASP.NET Core MVC is a model view controller framework for building dynamic web sites with clean separation of concerns, including the merged MVC, Web API, and Web Pages w/ Razor. Project moved to https://github.com/aspnet/AspNetCore
|
|
|
openiddict/openiddict-core
Flexible and versatile OAuth 2.0/OpenID Connect stack for .NET
|
|
|
Azure/azure-powershell
Microsoft Azure PowerShell
|
|
|
LavaGang/MelonLoader
The World's First Universal Mod Loader for Unity Games compatible with both Il2Cpp and Mono
|
|
|
hardkoded/puppeteer-sharp
Headless Chrome .NET API
|
|
|
dotnet/aspnet-api-versioning
Provides a set of libraries which add service API versioning to ASP.NET Web API, OData with ASP.NET Web API, and ASP.NET Core.
|
|
|
dotnet/extensions
This repository contains a suite of libraries that provide facilities commonly needed when creating production-ready applications.
|
|
|
projectkudu/kudu
Kudu is the engine behind git/hg deployments, WebJobs, and various other features in Azure Web Sites. It can also run outside of Azure.
|
|
|
1357310795/MyComputerManager
管理“此电脑”里删不掉的流氓“快捷方式”(包括侧边栏),同时可自己添加这类“快捷方式”
|
|
|
microsoft/playwright-dotnet
.NET version of the Playwright testing and automation library.
|
|
|
microsoft/PowerApps-Samples
Sample code for Power Apps, including Dataverse, model-driven apps, canvas apps, Power Apps component framework, portals, and AI Builder.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.0-preview.5.26302.115 | 6,765 | 6/9/2026 |
| 11.0.0-preview.4.26230.115 | 36,800 | 5/12/2026 |
| 11.0.0-preview.3.26207.106 | 65,163 | 4/14/2026 |
| 11.0.0-preview.2.26159.112 | 95,050 | 3/10/2026 |
| 11.0.0-preview.1.26104.118 | 94,929 | 2/10/2026 |
| 10.0.9 | 2,439,918 | 6/9/2026 |
| 10.0.8 | 13,410,929 | 5/12/2026 |
| 10.0.7 | 19,461,364 | 4/21/2026 |
| 10.0.6 | 8,945,728 | 4/14/2026 |
| 10.0.5 | 24,930,467 | 3/12/2026 |
| 10.0.4 | 9,195,449 | 3/10/2026 |
| 10.0.3 | 43,229,216 | 2/10/2026 |
| 10.0.2 | 33,266,659 | 1/13/2026 |
| 10.0.1 | 30,014,289 | 12/9/2025 |
| 9.0.17 | 211,093 | 6/9/2026 |
| 9.0.16 | 1,077,685 | 5/12/2026 |
| 9.0.15 | 2,366,132 | 4/14/2026 |
| 9.0.14 | 3,327,839 | 3/10/2026 |
| 9.0.13 | 7,958,997 | 2/10/2026 |
| 9.0.12 | 4,376,232 | 1/13/2026 |