diff --git a/eng/intellisense.targets b/eng/intellisense.targets index b1cfcdd8bbe8c..fc439383eb38b 100644 --- a/eng/intellisense.targets +++ b/eng/intellisense.targets @@ -1,32 +1,38 @@ - + - true + true - - - - - - + $([MSBuild]::NormalizeDirectory('$(NuGetPackageRoot)', 'microsoft.private.intellisense', '$(MicrosoftPrivateIntellisenseVersion)', 'IntellisenseFiles')) $([MSBuild]::NormalizePath('$(IntellisensePackageXmlRootFolder)', 'net', '1033', '$(AssemblyName).xml')) $([MSBuild]::NormalizePath('$(IntellisensePackageXmlRootFolder)', 'dotnet-plat-ext', '1033', '$(AssemblyName).xml')) $(IntellisensePackageXmlFilePathFromNetFolder) $(IntellisensePackageXmlFilePathFromDotNetPlatExtFolder) + + + true + - $(NoWarn);1591 + + + + $(UseCompilerGeneratedDocXmlFile) + $(IsPartialFacadeAssembly) + true + + + @@ -34,7 +40,7 @@ + Condition="'$(UseCompilerGeneratedDocXmlFile)' != 'true' and '$(IntellisensePackageXmlFilePath)' != ''"> diff --git a/src/libraries/Directory.Build.props b/src/libraries/Directory.Build.props index 3f808e7eb4f6a..9d6f6c385bb4d 100644 --- a/src/libraries/Directory.Build.props +++ b/src/libraries/Directory.Build.props @@ -2,7 +2,7 @@ true true diff --git a/src/libraries/Microsoft.Bcl.AsyncInterfaces/src/Microsoft.Bcl.AsyncInterfaces.csproj b/src/libraries/Microsoft.Bcl.AsyncInterfaces/src/Microsoft.Bcl.AsyncInterfaces.csproj index 313bc2ab4868d..0f0f1ce3deafc 100644 --- a/src/libraries/Microsoft.Bcl.AsyncInterfaces/src/Microsoft.Bcl.AsyncInterfaces.csproj +++ b/src/libraries/Microsoft.Bcl.AsyncInterfaces/src/Microsoft.Bcl.AsyncInterfaces.csproj @@ -1,4 +1,5 @@ + netstandard2.0;$(NetFrameworkMinimum);netstandard2.1 true @@ -9,10 +10,14 @@ Commonly Used Types: System.IAsyncDisposable System.Collections.Generic.IAsyncEnumerable System.Collections.Generic.IAsyncEnumerator + + false + true + @@ -40,8 +45,10 @@ System.Collections.Generic.IAsyncEnumerator System.Private.CoreLib\System\Runtime\CompilerServices\EnumeratorCancellationAttribute.cs + + diff --git a/src/libraries/Microsoft.Bcl.Cryptography/src/Microsoft.Bcl.Cryptography.csproj b/src/libraries/Microsoft.Bcl.Cryptography/src/Microsoft.Bcl.Cryptography.csproj index 0c5d787e2aff2..07291c966fb07 100644 --- a/src/libraries/Microsoft.Bcl.Cryptography/src/Microsoft.Bcl.Cryptography.csproj +++ b/src/libraries/Microsoft.Bcl.Cryptography/src/Microsoft.Bcl.Cryptography.csproj @@ -1,4 +1,5 @@ + $(NetCoreAppCurrent);netstandard2.0;$(NetFrameworkMinimum) true @@ -11,6 +12,8 @@ Commonly Used Types: System.Security.Cryptography.SP800108HmacCounterKdf + + false @@ -72,4 +75,5 @@ System.Security.Cryptography.SP800108HmacCounterKdf + diff --git a/src/libraries/Microsoft.Bcl.TimeProvider/src/Microsoft.Bcl.TimeProvider.csproj b/src/libraries/Microsoft.Bcl.TimeProvider/src/Microsoft.Bcl.TimeProvider.csproj index 28f1099e3c20d..95e508e6f0d2b 100644 --- a/src/libraries/Microsoft.Bcl.TimeProvider/src/Microsoft.Bcl.TimeProvider.csproj +++ b/src/libraries/Microsoft.Bcl.TimeProvider/src/Microsoft.Bcl.TimeProvider.csproj @@ -12,6 +12,8 @@ Commonly Used Types: System.TimeProvider System.ITimer + + false diff --git a/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/CacheEntryExtensions.cs b/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/CacheEntryExtensions.cs index 14a5a7dc32de7..f991a4adebdc0 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/CacheEntryExtensions.cs +++ b/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/CacheEntryExtensions.cs @@ -7,6 +7,9 @@ namespace Microsoft.Extensions.Caching.Memory { + /// + /// Provide extensions methods for operations. + /// public static class CacheEntryExtensions { /// diff --git a/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/CacheItemPriority.cs b/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/CacheItemPriority.cs index d1246e8947167..4bd0807bf70e9 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/CacheItemPriority.cs +++ b/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/CacheItemPriority.cs @@ -9,9 +9,24 @@ namespace Microsoft.Extensions.Caching.Memory /// public enum CacheItemPriority { + /// + /// The cache entry should be removed as soon as possible during memory pressure triggered cleanup. + /// Low, + + /// + /// The cache entry should be removed if there is no other low priority cache entries during memory pressure triggered cleanup. + /// Normal, + + /// + /// The cache entry should be removed only when there is no other low or normal priority cache entries during memory pressure triggered cleanup. + /// High, + + /// + /// The cache entry should never be removed during memory pressure triggered cleanup. + /// NeverRemove, } } diff --git a/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/DistributedCacheEntryExtensions.cs b/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/DistributedCacheEntryExtensions.cs index e9ddf9ca12616..f5a048ee3a7cc 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/DistributedCacheEntryExtensions.cs +++ b/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/DistributedCacheEntryExtensions.cs @@ -5,6 +5,9 @@ namespace Microsoft.Extensions.Caching.Distributed { + /// + /// Extension methods for operations. + /// public static class DistributedCacheEntryExtensions { /// diff --git a/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/EvictionReason.cs b/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/EvictionReason.cs index 43f7362675e12..cda9683579246 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/EvictionReason.cs +++ b/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/EvictionReason.cs @@ -3,32 +3,38 @@ namespace Microsoft.Extensions.Caching.Memory { + /// + /// Specify the reasons why an entry was evicted from the cache. + /// public enum EvictionReason { + /// + /// The item was not removed from the cache. + /// None, /// - /// Manually + /// The item was removed from the cache manually. /// Removed, /// - /// Overwritten + /// The item was removed from the cache because it was overwritten. /// Replaced, /// - /// Timed out + /// The item was removed from the cache because it timed out. /// Expired, /// - /// Event + /// The item was removed from the cache because its token expired. /// TokenExpired, /// - /// Overflow + /// The item was removed from the cache because it exceeded its capacity. /// Capacity, } diff --git a/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/MemoryCacheEntryExtensions.cs b/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/MemoryCacheEntryExtensions.cs index aab7cf5ae0577..9a2a87918d4cb 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/MemoryCacheEntryExtensions.cs +++ b/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/MemoryCacheEntryExtensions.cs @@ -6,6 +6,9 @@ namespace Microsoft.Extensions.Caching.Memory { + /// + /// Provide extensions methods for operations. + /// public static class MemoryCacheEntryExtensions { /// diff --git a/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/MemoryCacheExtensions.cs b/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/MemoryCacheExtensions.cs index 94130871d0517..71731030634f3 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/MemoryCacheExtensions.cs +++ b/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/MemoryCacheExtensions.cs @@ -7,19 +7,43 @@ namespace Microsoft.Extensions.Caching.Memory { + /// + /// Provide extensions methods for operations. + /// public static class CacheExtensions { + /// + /// Gets the value associated with this key if present. + /// + /// The instance this method extends. + /// The key of the value to get. + /// The value associated with this key, or null if the key is not present. public static object? Get(this IMemoryCache cache, object key) { cache.TryGetValue(key, out object? value); return value; } + /// + /// Gets the value associated with this key if present. + /// + /// The type of the object to get. + /// The instance this method extends. + /// The key of the value to get. + /// The value associated with this key, or default(TItem) if the key is not present. public static TItem? Get(this IMemoryCache cache, object key) { return (TItem?)(cache.Get(key) ?? default(TItem)); } + /// + /// Try to get the value associated with the given key. + /// + /// The type of the object to get. + /// The instance this method extends. + /// The key of the value to get. + /// The value associated with the given key. + /// true if the key was found. false otherwise. public static bool TryGetValue(this IMemoryCache cache, object key, out TItem? value) { if (cache.TryGetValue(key, out object? result)) @@ -41,6 +65,14 @@ public static bool TryGetValue(this IMemoryCache cache, object key, out T return false; } + /// + /// Associate a value with a key in the . + /// + /// The type of the object to set. + /// The instance this method extends. + /// The key of the entry to add. + /// The value to associate with the key. + /// The value that was set. public static TItem Set(this IMemoryCache cache, object key, TItem value) { using ICacheEntry entry = cache.CreateEntry(key); @@ -49,6 +81,15 @@ public static TItem Set(this IMemoryCache cache, object key, TItem value) return value; } + /// + /// Sets a cache entry with the given key and value that will expire in the given duration. + /// + /// The type of the object to set. + /// The instance this method extends. + /// The key of the entry to add. + /// The value to associate with the key. + /// The point in time at which the cache entry will expire. + /// The value that was set. public static TItem Set(this IMemoryCache cache, object key, TItem value, DateTimeOffset absoluteExpiration) { using ICacheEntry entry = cache.CreateEntry(key); @@ -58,6 +99,15 @@ public static TItem Set(this IMemoryCache cache, object key, TItem value, return value; } + /// + /// Sets a cache entry with the given key and value that will expire in the given duration from now. + /// + /// The type of the object to set. + /// The instance this method extends. + /// The key of the entry to add. + /// The value to associate with the key. + /// The duration from now after which the cache entry will expire. + /// The value that was set. public static TItem Set(this IMemoryCache cache, object key, TItem value, TimeSpan absoluteExpirationRelativeToNow) { using ICacheEntry entry = cache.CreateEntry(key); @@ -67,6 +117,15 @@ public static TItem Set(this IMemoryCache cache, object key, TItem value, return value; } + /// + /// Sets a cache entry with the given key and value that will expire when expires. + /// + /// The type of the object to set. + /// The instance this method extends. + /// The key of the entry to add. + /// The value to associate with the key. + /// The that causes the cache entry to expire. + /// The value that was set. public static TItem Set(this IMemoryCache cache, object key, TItem value, IChangeToken expirationToken) { using ICacheEntry entry = cache.CreateEntry(key); @@ -76,6 +135,15 @@ public static TItem Set(this IMemoryCache cache, object key, TItem value, return value; } + /// + /// Sets a cache entry with the given key and value and apply the values of an existing to the created entry. + /// + /// The type of the object to set. + /// The instance this method extends. + /// The key of the entry to add. + /// The value to associate with the key. + /// The existing instance to apply to the new entry. + /// The value that was set. public static TItem Set(this IMemoryCache cache, object key, TItem value, MemoryCacheEntryOptions? options) { using ICacheEntry entry = cache.CreateEntry(key); @@ -89,6 +157,14 @@ public static TItem Set(this IMemoryCache cache, object key, TItem value, return value; } + /// + /// Gets the value associated with this key if it exists, or generates a new entry using the provided key and a value from the given factory if the key is not found. + /// + /// The type of the object to get. + /// The instance this method extends. + /// The key of the entry to look for or create. + /// The factory that creates the value associated with this key if the key does not exist in the cache. + /// The value associated with this key. public static TItem? GetOrCreate(this IMemoryCache cache, object key, Func factory) { if (!cache.TryGetValue(key, out object? result)) @@ -102,6 +178,14 @@ public static TItem Set(this IMemoryCache cache, object key, TItem value, return (TItem?)result; } + /// + /// Asynchronously gets the value associated with this key if it exists, or generates a new entry using the provided key and a value from the given factory if the key is not found. + /// + /// The type of the object to get. + /// The instance this method extends. + /// The key of the entry to look for or create. + /// The factory task that creates the value associated with this key if the key does not exist in the cache. + /// The task object representing the asynchronous operation. public static async Task GetOrCreateAsync(this IMemoryCache cache, object key, Func> factory) { if (!cache.TryGetValue(key, out object? result)) diff --git a/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/PostEvictionCallbackRegistration.cs b/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/PostEvictionCallbackRegistration.cs index 4c4c950a45569..9cfbdf6231d03 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/PostEvictionCallbackRegistration.cs +++ b/src/libraries/Microsoft.Extensions.Caching.Abstractions/src/PostEvictionCallbackRegistration.cs @@ -3,10 +3,19 @@ namespace Microsoft.Extensions.Caching.Memory { + /// + /// Represents a callback delegate that will be fired after an entry is evicted from the cache. + /// public class PostEvictionCallbackRegistration { + /// + /// Gets or sets the callback delegate that will be fired after an entry is evicted from the cache. + /// public PostEvictionDelegate? EvictionCallback { get; set; } + /// + /// Gets or sets the state to pass to the callback delegate. + /// public object? State { get; set; } } } diff --git a/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCache.cs b/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCache.cs index 88b4af2a9e9c8..24212fbc65c68 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCache.cs +++ b/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCache.cs @@ -587,11 +587,16 @@ static void ExpirePriorityBucket(ref long removedSize, long removalSizeTarget, F } } + /// public void Dispose() { Dispose(true); } + /// + /// Dispose the cache and clear all entries. + /// + /// Dispose the object resources if true; otherwise, take no action. protected virtual void Dispose(bool disposing) { if (!_disposed) diff --git a/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCacheOptions.cs b/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCacheOptions.cs index 15a4eaf220e52..7401c97d04ae8 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCacheOptions.cs +++ b/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCacheOptions.cs @@ -8,6 +8,9 @@ namespace Microsoft.Extensions.Caching.Memory { + /// + /// Options class for . + /// public class MemoryCacheOptions : IOptions { private long _sizeLimit = NotSet; @@ -15,6 +18,9 @@ public class MemoryCacheOptions : IOptions private const int NotSet = -1; + /// + /// Gets or sets the clock used by the cache for expiration. + /// public ISystemClock? Clock { get; set; } /// @@ -43,6 +49,9 @@ public long? SizeLimit } } + /// + /// Enables ot disables the option to compact the cache when the maximum size is exceeded. + /// [EditorBrowsableAttribute(EditorBrowsableState.Never)] [Obsolete("This property is retained only for compatibility. Remove use and instead call MemoryCache.Compact as needed.", error: true)] public bool CompactOnMemoryPressure { get; set; } diff --git a/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryDistributedCache.cs b/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryDistributedCache.cs index f7b1ee34b9387..7d6b45c200976 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryDistributedCache.cs +++ b/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryDistributedCache.cs @@ -11,13 +11,25 @@ namespace Microsoft.Extensions.Caching.Distributed { + /// + /// An implementation of using . + /// public class MemoryDistributedCache : IDistributedCache { private readonly MemoryCache _memCache; + /// + /// Creates a new instance. + /// + /// The options of the cache. public MemoryDistributedCache(IOptions optionsAccessor) : this(optionsAccessor, NullLoggerFactory.Instance) { } + /// + /// Creates a new instance. + /// + /// The options of the cache. + /// The logger factory to create used to log messages. public MemoryDistributedCache(IOptions optionsAccessor, ILoggerFactory loggerFactory) { ThrowHelper.ThrowIfNull(optionsAccessor); @@ -26,6 +38,11 @@ public MemoryDistributedCache(IOptions optionsAcc _memCache = new MemoryCache(optionsAccessor.Value, loggerFactory); } + /// + /// Gets the specified item associated with a key from the as a byte array. + /// + /// The key of the item to get. + /// The byte array value of the key. public byte[]? Get(string key) { ThrowHelper.ThrowIfNull(key); @@ -33,6 +50,12 @@ public MemoryDistributedCache(IOptions optionsAcc return (byte[]?)_memCache.Get(key); } + /// + /// Asynchronously gets the specified item associated with a key from the as a byte array. + /// + /// The key of the item to get. + /// The to use to cancel operation. + /// The task for getting the byte array value associated with the specified key from the cache. public Task GetAsync(string key, CancellationToken token = default(CancellationToken)) { ThrowHelper.ThrowIfNull(key); @@ -40,6 +63,12 @@ public MemoryDistributedCache(IOptions optionsAcc return Task.FromResult(Get(key)); } + /// + /// Sets the specified item associated with a key in the as a byte array. + /// + /// The key of the item to set. + /// The byte array value of the item to set. + /// The cache options for the item to set. public void Set(string key, byte[] value, DistributedCacheEntryOptions options) { ThrowHelper.ThrowIfNull(key); @@ -55,6 +84,14 @@ public void Set(string key, byte[] value, DistributedCacheEntryOptions options) _memCache.Set(key, value, memoryCacheEntryOptions); } + /// + /// Asynchronously sets the specified item associated with a key in the as a byte array. + /// + /// The key of the item to set. + /// The byte array value of the item to set. + /// The cache options for the item to set. + /// The to use to cancel operation. + /// The task for setting the byte array value associated with the specified key in the cache. public Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options, CancellationToken token = default(CancellationToken)) { ThrowHelper.ThrowIfNull(key); @@ -65,6 +102,10 @@ public void Set(string key, byte[] value, DistributedCacheEntryOptions options) return Task.CompletedTask; } + /// + /// Refreshes the specified item associated with a key from the . + /// + /// The key of the item to refresh. public void Refresh(string key) { ThrowHelper.ThrowIfNull(key); @@ -72,6 +113,12 @@ public void Refresh(string key) _memCache.TryGetValue(key, out _); } + /// + /// Asynchronously refreshes the specified item associated with a key from the . + /// + /// The key of the item to refresh. + /// The to use to cancel operation. + /// The task for refreshing the specified key in the cache. public Task RefreshAsync(string key, CancellationToken token = default(CancellationToken)) { ThrowHelper.ThrowIfNull(key); @@ -80,6 +127,10 @@ public void Refresh(string key) return Task.CompletedTask; } + /// + /// Removes the specified item associated with a key from the . + /// + /// The key of the item to remove. public void Remove(string key) { ThrowHelper.ThrowIfNull(key); @@ -87,6 +138,12 @@ public void Remove(string key) _memCache.Remove(key); } + /// + /// Asynchronously removes the specified item associated with a key from the . + /// + /// The key of the item to remove. + /// The to use to cancel operation. + /// The task for removing the specified key from the cache. public Task RemoveAsync(string key, CancellationToken token = default(CancellationToken)) { ThrowHelper.ThrowIfNull(key); diff --git a/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryDistributedCacheOptions.cs b/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryDistributedCacheOptions.cs index c90f612b0ba6b..73afd8100e0a2 100644 --- a/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryDistributedCacheOptions.cs +++ b/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryDistributedCacheOptions.cs @@ -3,8 +3,14 @@ namespace Microsoft.Extensions.Caching.Memory { + /// + /// Options class for . + /// public class MemoryDistributedCacheOptions : MemoryCacheOptions { + /// + /// Initializes a new instance of . + /// public MemoryDistributedCacheOptions() : base() { diff --git a/src/libraries/Microsoft.Extensions.Configuration.Abstractions/src/ConfigurationDebugViewContext.cs b/src/libraries/Microsoft.Extensions.Configuration.Abstractions/src/ConfigurationDebugViewContext.cs index ec53db48792b7..4f7b3d6fa270b 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Abstractions/src/ConfigurationDebugViewContext.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Abstractions/src/ConfigurationDebugViewContext.cs @@ -8,6 +8,13 @@ namespace Microsoft.Extensions.Configuration /// public readonly struct ConfigurationDebugViewContext { + /// + /// Initializes a new instance of . + /// + /// The path of the current item of the configuration. + /// The key of the current item of the configuration. + /// The value of the current item of the configuration. + /// The to use to get the value of the current item. public ConfigurationDebugViewContext(string path, string key, string? value, IConfigurationProvider configurationProvider) { Path = path; diff --git a/src/libraries/Microsoft.Extensions.Configuration.Abstractions/src/ConfigurationKeyNameAttribute.cs b/src/libraries/Microsoft.Extensions.Configuration.Abstractions/src/ConfigurationKeyNameAttribute.cs index d9aeb155804f1..d9a4e52026778 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.Abstractions/src/ConfigurationKeyNameAttribute.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.Abstractions/src/ConfigurationKeyNameAttribute.cs @@ -5,11 +5,21 @@ namespace Microsoft.Extensions.Configuration { + /// + /// Specifies the key name for a configuration property. + /// [AttributeUsage(AttributeTargets.Property)] public sealed class ConfigurationKeyNameAttribute : Attribute { + /// + /// Initializes a new instance of . + /// + /// The key name. public ConfigurationKeyNameAttribute(string name) => Name = name; + /// + /// The key name for a configuration property. + /// public string Name { get; } } } diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/FromKeyedServicesAttribute.cs b/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/FromKeyedServicesAttribute.cs index a7ff22e94b59e..c36a91ccefebf 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/FromKeyedServicesAttribute.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/FromKeyedServicesAttribute.cs @@ -5,11 +5,21 @@ namespace Microsoft.Extensions.DependencyInjection { + /// + /// Indicates that the parameter should be bound using the keyed service registered with the specified key. + /// [AttributeUsage(AttributeTargets.Parameter)] public class FromKeyedServicesAttribute : Attribute { + /// + /// Creates a new instance. + /// + /// The key of the keyed service to bind to. public FromKeyedServicesAttribute(object key) => Key = key; + /// + /// The key of the keyed service to bind to. + /// public object Key { get; } } } diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/IKeyedServiceProvider.cs b/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/IKeyedServiceProvider.cs index ff6814eace2e0..af025a5bf6a8b 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/IKeyedServiceProvider.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/IKeyedServiceProvider.cs @@ -5,6 +5,10 @@ namespace Microsoft.Extensions.DependencyInjection { + /// + /// IKeyedServiceProvider is a service provider that can be used to retrieve services using a key in addition + /// to a type. + /// public interface IKeyedServiceProvider : IServiceProvider { /// @@ -26,8 +30,14 @@ public interface IKeyedServiceProvider : IServiceProvider object GetRequiredKeyedService(Type serviceType, object? serviceKey); } + /// + /// Statics for use with . + /// public static class KeyedService { + /// + /// Represents a key that matches any key. + /// public static object AnyKey { get; } = new AnyKeyObj(); private sealed class AnyKeyObj diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/IServiceProviderIsKeyedService.cs b/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/IServiceProviderIsKeyedService.cs index 39cda6b1ebcfc..1517011a67b99 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/IServiceProviderIsKeyedService.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/IServiceProviderIsKeyedService.cs @@ -5,10 +5,15 @@ namespace Microsoft.Extensions.DependencyInjection { + /// + /// Optional service used to determine if the specified type with the specified service key is available + /// from the . + /// public interface IServiceProviderIsKeyedService : IServiceProviderIsService { /// - /// Determines if the specified service type is available from the . + /// Determines if the specified service type with the specified service key is available from the + /// . /// /// An object that specifies the type of service object to test. /// The of the service. diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/ServiceDescriptor.cs b/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/ServiceDescriptor.cs index 4edb491cc6ccf..9790066b4bc8a 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/ServiceDescriptor.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/ServiceDescriptor.cs @@ -247,6 +247,9 @@ public Func? ImplementationFactory } } + /// + /// Indicates whether the service is a keyed service. + /// public bool IsKeyedService => ServiceKey != null; /// diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/ServiceKeyAttribute.cs b/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/ServiceKeyAttribute.cs index f9dfc985b82e6..eccdd34b48b8f 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/ServiceKeyAttribute.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/ServiceKeyAttribute.cs @@ -5,6 +5,10 @@ namespace Microsoft.Extensions.DependencyInjection { + /// + /// ServiceKeyAttribute can be specified on a parameter to inject the key that was used for + /// registration/resolution. + /// [AttributeUsage(AttributeTargets.Parameter)] public class ServiceKeyAttribute : Attribute { diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceProvider.cs b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceProvider.cs index 6fe894db8d7a1..aa178741fc451 100644 --- a/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceProvider.cs +++ b/src/libraries/Microsoft.Extensions.DependencyInjection/src/ServiceProvider.cs @@ -97,12 +97,25 @@ internal ServiceProvider(ICollection serviceDescriptors, Serv /// The service that was produced. public object? GetService(Type serviceType) => GetService(ServiceIdentifier.FromServiceType(serviceType), Root); + /// + /// Gets the service object of the specified type with the specified key. + /// + /// The type of the service to get. + /// The key of the service to get. + /// The keyed service. public object? GetKeyedService(Type serviceType, object? serviceKey) => GetKeyedService(serviceType, serviceKey, Root); internal object? GetKeyedService(Type serviceType, object? serviceKey, ServiceProviderEngineScope serviceProviderEngineScope) => GetService(new ServiceIdentifier(serviceKey, serviceType), serviceProviderEngineScope); + /// + /// Gets the service object of the specified type. Will throw if the service not found. + /// + /// The type of the service to get. + /// The key of the service to get. + /// The keyed service. + /// public object GetRequiredKeyedService(Type serviceType, object? serviceKey) => GetRequiredKeyedService(serviceType, serviceKey, Root); diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/src/Microsoft.Extensions.DependencyModel.csproj b/src/libraries/Microsoft.Extensions.DependencyModel/src/Microsoft.Extensions.DependencyModel.csproj index ca71ccf4d0d34..6cd3d26b2b6f6 100644 --- a/src/libraries/Microsoft.Extensions.DependencyModel/src/Microsoft.Extensions.DependencyModel.csproj +++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/Microsoft.Extensions.DependencyModel.csproj @@ -6,6 +6,8 @@ Provides abstractions for reading `.deps` files. When a .NET application is compiled, the SDK generates a JSON manifest file (`<ApplicationName>.deps.json`) that contains information about application dependencies. You can use `Microsoft.Extensions.DependencyModel` to read information from this manifest at run time. This is useful when you want to dynamically compile code (for example, using Roslyn Emit API) referencing the same dependencies as your main application. By default, the dependency manifest contains information about the application's target framework and runtime dependencies. Set the PreserveCompilationContext project property to `true` to additionally include information about reference assemblies used during compilation. + + false diff --git a/src/libraries/Microsoft.Extensions.FileSystemGlobbing/src/Microsoft.Extensions.FileSystemGlobbing.csproj b/src/libraries/Microsoft.Extensions.FileSystemGlobbing/src/Microsoft.Extensions.FileSystemGlobbing.csproj index f26d1a78d7322..1585ccc2e14af 100644 --- a/src/libraries/Microsoft.Extensions.FileSystemGlobbing/src/Microsoft.Extensions.FileSystemGlobbing.csproj +++ b/src/libraries/Microsoft.Extensions.FileSystemGlobbing/src/Microsoft.Extensions.FileSystemGlobbing.csproj @@ -5,6 +5,8 @@ true true File system globbing to find files matching a specified pattern. + + false diff --git a/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/BackgroundService.cs b/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/BackgroundService.cs index d8172e9b61659..a5c45d12a27b6 100644 --- a/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/BackgroundService.cs +++ b/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/BackgroundService.cs @@ -84,6 +84,7 @@ public virtual async Task StopAsync(CancellationToken cancellationToken) } + /// public virtual void Dispose() { _stoppingCts?.Cancel(); diff --git a/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/EnvironmentName.cs b/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/EnvironmentName.cs index bddf9e8cee172..dea97b18eca1f 100644 --- a/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/EnvironmentName.cs +++ b/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/EnvironmentName.cs @@ -13,8 +13,19 @@ namespace Microsoft.Extensions.Hosting [System.Obsolete("EnvironmentName has been deprecated. Use Microsoft.Extensions.Hosting.Environments instead.")] public static class EnvironmentName { + /// + /// The name of the Development environment. + /// public static readonly string Development = "Development"; + + /// + /// The name of the Staging environment. + /// public static readonly string Staging = "Staging"; + + /// + /// The name of the Production environment. + /// public static readonly string Production = "Production"; } } diff --git a/src/libraries/Microsoft.Extensions.Hosting/src/Internal/ApplicationLifetime.cs b/src/libraries/Microsoft.Extensions.Hosting/src/Internal/ApplicationLifetime.cs index fc6635639721a..2faae1acd5907 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/src/Internal/ApplicationLifetime.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/src/Internal/ApplicationLifetime.cs @@ -23,6 +23,10 @@ public class ApplicationLifetime : IApplicationLifetime, IHostApplicationLifetim private readonly CancellationTokenSource _stoppedSource = new CancellationTokenSource(); private readonly ILogger _logger; + /// + /// Initializes an instance using the specified logger. + /// + /// The logger to initialize this instance with. public ApplicationLifetime(ILogger logger) { _logger = logger; diff --git a/src/libraries/Microsoft.Extensions.Hosting/src/Internal/ConsoleLifetime.cs b/src/libraries/Microsoft.Extensions.Hosting/src/Internal/ConsoleLifetime.cs index 372a6146c55d2..fdc6d3ca4acd4 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/src/Internal/ConsoleLifetime.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/src/Internal/ConsoleLifetime.cs @@ -23,9 +23,26 @@ public partial class ConsoleLifetime : IHostLifetime, IDisposable private CancellationTokenRegistration _applicationStartedRegistration; private CancellationTokenRegistration _applicationStoppingRegistration; + /// + /// Initializes a instance using the specified console lifetime options, host environment, host application lifetime and host options. + /// + /// An object used to retrieve instances. + /// An object that contains information about the hosting environment an application is running in. + /// An object that allows consumers to be notified of application lifetime events. + /// An object used to retrieve instances. + /// or or or is . public ConsoleLifetime(IOptions options, IHostEnvironment environment, IHostApplicationLifetime applicationLifetime, IOptions hostOptions) : this(options, environment, applicationLifetime, hostOptions, NullLoggerFactory.Instance) { } + /// + /// Initializes a instance using the specified console lifetime options, host environment, host options and logger factory. + /// + /// An object used to retrieve instances + /// An object that contains information about the hosting environment an application is running in. + /// An object that allows consumers to be notified of application lifetime events. + /// An object used to retrieve instances. + /// An object to configure the logging system and create instances of from the registered . + /// or or or is . public ConsoleLifetime(IOptions options, IHostEnvironment environment, IHostApplicationLifetime applicationLifetime, IOptions hostOptions, ILoggerFactory loggerFactory) { ThrowHelper.ThrowIfNull(options?.Value, nameof(options)); @@ -50,6 +67,11 @@ public ConsoleLifetime(IOptions options, IHostEnvironmen private ILogger Logger { get; } + /// + /// Registers the application start, application stop and shutdown handlers for this application. + /// + /// The cancellation token to monitor for cancellation requests. + /// A that represents the asynchronous registration operation. public Task WaitForStartAsync(CancellationToken cancellationToken) { if (!Options.SuppressStatusMessages) @@ -86,12 +108,20 @@ private void OnApplicationStopping() Logger.LogInformation("Application is shutting down..."); } + /// + /// This method does nothing. + /// + /// A cancellation token instance. + /// A that represents a completed task. public Task StopAsync(CancellationToken cancellationToken) { // There's nothing to do here return Task.CompletedTask; } + /// + /// Unregisters the shutdown handlers and disposes the application start and application stop registrations. + /// public void Dispose() { UnregisterShutdownHandlers(); diff --git a/src/libraries/Microsoft.Extensions.Hosting/src/Internal/HostingEnvironment.cs b/src/libraries/Microsoft.Extensions.Hosting/src/Internal/HostingEnvironment.cs index 0bb985ac92901..24d29ea9c177a 100644 --- a/src/libraries/Microsoft.Extensions.Hosting/src/Internal/HostingEnvironment.cs +++ b/src/libraries/Microsoft.Extensions.Hosting/src/Internal/HostingEnvironment.cs @@ -15,12 +15,24 @@ namespace Microsoft.Extensions.Hosting.Internal public class HostingEnvironment : IHostingEnvironment, IHostEnvironment #pragma warning restore CS0618 // Type or member is obsolete { + /// + /// This API supports infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases. + /// public string EnvironmentName { get; set; } = string.Empty; + /// + /// This API supports infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases. + /// public string ApplicationName { get; set; } = string.Empty; + /// + /// This API supports infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases. + /// public string ContentRootPath { get; set; } = string.Empty; + /// + /// This API supports infrastructure and is not intended to be used directly from your code. This API may change or be removed in future releases. + /// public IFileProvider ContentRootFileProvider { get; set; } = null!; } } diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConfigurationConsoleLoggerSettings.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConfigurationConsoleLoggerSettings.cs index 9ac19144b737b..9bf4c7e08350c 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConfigurationConsoleLoggerSettings.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConfigurationConsoleLoggerSettings.cs @@ -8,20 +8,33 @@ namespace Microsoft.Extensions.Logging.Console { + /// + /// Settings for a . + /// [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This type is retained only for compatibility. The recommended alternative is ConsoleLoggerOptions.")] public class ConfigurationConsoleLoggerSettings : IConsoleLoggerSettings { internal readonly IConfiguration _configuration; + /// + /// Creates a new instance of . + /// + /// provides access to configuration values. public ConfigurationConsoleLoggerSettings(IConfiguration configuration) { _configuration = configuration; ChangeToken = configuration.GetReloadToken(); } + /// + /// Gets the propagates notifications that a change has occurred. + /// public IChangeToken? ChangeToken { get; private set; } + /// + /// Gets a value indicating whether scopes should be included in the message. + /// public bool IncludeScopes { get @@ -44,12 +57,23 @@ public bool IncludeScopes } } + /// + /// Reload the settings from the configuration. + /// + /// The reloaded settings. public IConsoleLoggerSettings Reload() { ChangeToken = null!; return new ConfigurationConsoleLoggerSettings(_configuration); } + /// + /// Gets the log level for the specified switch. + /// + /// The name of the switch to look up + /// An out parameter that will be set to the value of the switch if it is found. If the switch is not found, the method returns false and sets the value of level to LogLevel.None + /// True if the switch was found, otherwise false. + /// public bool TryGetSwitch(string name, out LogLevel level) { var switches = _configuration.GetSection("LogLevel"); diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatter.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatter.cs index e7a8c7eeb37a2..d963e6af7f112 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatter.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatter.cs @@ -12,6 +12,10 @@ namespace Microsoft.Extensions.Logging.Console /// public abstract class ConsoleFormatter { + /// + /// Initializes a new instance of . + /// + /// protected ConsoleFormatter(string name) { ThrowHelper.ThrowIfNull(name); diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerExtensions.Obsolete.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerExtensions.Obsolete.cs index 4e8d31a3a7395..5915c0721142b 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerExtensions.Obsolete.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerExtensions.Obsolete.cs @@ -13,6 +13,12 @@ namespace Microsoft.Extensions.Logging { public static partial class ConsoleLoggerExtensions { + /// + /// This method is retained only for compatibility. + /// + /// This method is retained only for compatibility. + /// This method is retained only for compatibility. + /// This method is retained only for compatibility. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is retained only for compatibility. The recommended alternative is AddConsole(this ILoggingBuilder builder).", error: true)] public static Logging.ILoggerFactory AddConsole(this Logging.ILoggerFactory factory, Extensions.Configuration.IConfiguration configuration) @@ -21,6 +27,12 @@ public static Logging.ILoggerFactory AddConsole(this Logging.ILoggerFactory fact return factory.AddConsole(settings); } + /// + /// This method is retained only for compatibility. + /// + /// This method is retained only for compatibility. + /// This method is retained only for compatibility. + /// This method is retained only for compatibility. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is retained only for compatibility. The recommended alternative is AddConsole(this ILoggingBuilder builder).", error: true)] public static Logging.ILoggerFactory AddConsole(this Logging.ILoggerFactory factory, Console.IConsoleLoggerSettings settings) @@ -29,6 +41,13 @@ public static Logging.ILoggerFactory AddConsole(this Logging.ILoggerFactory fact return factory; } + /// + /// This method is retained only for compatibility. + /// + /// This method is retained only for compatibility. + /// This method is retained only for compatibility. + /// This method is retained only for compatibility. + /// This method is retained only for compatibility. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is retained only for compatibility. The recommended alternative is AddConsole(this ILoggingBuilder builder).", error: true)] public static Logging.ILoggerFactory AddConsole(this Logging.ILoggerFactory factory, Logging.LogLevel minLevel, bool includeScopes) @@ -37,6 +56,12 @@ public static Logging.ILoggerFactory AddConsole(this Logging.ILoggerFactory fact return factory; } + /// + /// This method is retained only for compatibility. + /// + /// This method is retained only for compatibility. + /// This method is retained only for compatibility. + /// This method is retained only for compatibility. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is retained only for compatibility. The recommended alternative is AddConsole(this ILoggingBuilder builder).", error: true)] public static Logging.ILoggerFactory AddConsole(this Logging.ILoggerFactory factory, Logging.LogLevel minLevel) @@ -45,6 +70,12 @@ public static Logging.ILoggerFactory AddConsole(this Logging.ILoggerFactory fact return factory; } + /// + /// This method is retained only for compatibility. + /// + /// This method is retained only for compatibility. + /// This method is retained only for compatibility. + /// This method is retained only for compatibility. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is retained only for compatibility. The recommended alternative is AddConsole(this ILoggingBuilder builder).", error: true)] public static Logging.ILoggerFactory AddConsole(this Logging.ILoggerFactory factory, bool includeScopes) @@ -53,6 +84,13 @@ public static Logging.ILoggerFactory AddConsole(this Logging.ILoggerFactory fact return factory; } + /// + /// This method is retained only for compatibility. + /// + /// This method is retained only for compatibility. + /// This method is retained only for compatibility. + /// This method is retained only for compatibility. + /// This method is retained only for compatibility. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is retained only for compatibility. The recommended alternative is AddConsole(this ILoggingBuilder builder).", error: true)] public static Logging.ILoggerFactory AddConsole(this Logging.ILoggerFactory factory, System.Func filter, bool includeScopes) @@ -61,6 +99,12 @@ public static Logging.ILoggerFactory AddConsole(this Logging.ILoggerFactory fact return factory; } + /// + /// This method is retained only for compatibility. + /// + /// This method is retained only for compatibility. + /// This method is retained only for compatibility. + /// This method is retained only for compatibility. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is retained only for compatibility. The recommended alternative is AddConsole(this ILoggingBuilder builder).", error: true)] public static Logging.ILoggerFactory AddConsole(this Logging.ILoggerFactory factory, System.Func filter) @@ -69,6 +113,11 @@ public static Logging.ILoggerFactory AddConsole(this Logging.ILoggerFactory fact return factory; } + /// + /// This method is retained only for compatibility. + /// + /// This method is retained only for compatibility. + /// This method is retained only for compatibility. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is retained only for compatibility. The recommended alternative is AddConsole(this ILoggingBuilder builder).", error: true)] public static Logging.ILoggerFactory AddConsole(this Logging.ILoggerFactory factory) diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerExtensions.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerExtensions.cs index 9a7d5998afd4c..0dcdcee2a3c9e 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerExtensions.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerExtensions.cs @@ -14,6 +14,9 @@ namespace Microsoft.Extensions.Logging { + /// + /// Provides extension methods for the and classes. + /// [UnsupportedOSPlatform("browser")] public static partial class ConsoleLoggerExtensions { diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerSettings.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerSettings.cs index 77bd183cef358..ae9e2486f5f3b 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerSettings.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerSettings.cs @@ -8,23 +8,36 @@ namespace Microsoft.Extensions.Logging.Console { + /// + /// This type is retained only for compatibility. The recommended alternative is ConsoleLoggerOptions. + /// [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This type is retained only for compatibility. The recommended alternative is ConsoleLoggerOptions.", error: true)] public class ConsoleLoggerSettings : IConsoleLoggerSettings { + /// public IChangeToken? ChangeToken { get; set; } + /// public bool IncludeScopes { get; set; } + /// + /// This property is retained only for compatibility. + /// public bool DisableColors { get; set; } + /// + /// This property is retained only for compatibility. + /// public IDictionary Switches { get; set; } = new Dictionary(); + /// public IConsoleLoggerSettings Reload() { return this; } + /// public bool TryGetSwitch(string name, out LogLevel level) { return Switches.TryGetValue(name, out level); diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/IConsoleLoggerSettings.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/IConsoleLoggerSettings.cs index 81c2b846c5e3e..076d89318bb48 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/src/IConsoleLoggerSettings.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/IConsoleLoggerSettings.cs @@ -7,16 +7,35 @@ namespace Microsoft.Extensions.Logging.Console { + /// + /// This type is retained only for compatibility. The recommended alternative is ConsoleLoggerOptions. + /// [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This type is retained only for compatibility. The recommended alternative is ConsoleLoggerOptions.", error: true)] public interface IConsoleLoggerSettings { + /// + /// This property is retained only for compatibility. + /// bool IncludeScopes { get; } + /// + /// This property is retained only for compatibility. + /// IChangeToken? ChangeToken { get; } + /// + /// This property is retained only for compatibility. + /// + /// This property is retained only for compatibility. + /// This property is retained only for compatibility. + /// This property is retained only for compatibility. bool TryGetSwitch(string name, out LogLevel level); + /// + /// This method is retained only for compatibility. + /// + /// This method is retained only for compatibility. IConsoleLoggerSettings Reload(); } } diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/InplaceStringBuilder.cs b/src/libraries/Microsoft.Extensions.Primitives/src/InplaceStringBuilder.cs index 063de6effb241..051abb43be0b0 100644 --- a/src/libraries/Microsoft.Extensions.Primitives/src/InplaceStringBuilder.cs +++ b/src/libraries/Microsoft.Extensions.Primitives/src/InplaceStringBuilder.cs @@ -8,6 +8,9 @@ namespace Microsoft.Extensions.Primitives { + /// + /// Provides a mechanism for fast, non-allocating string concatenation. + /// [DebuggerDisplay("Value = {_value}")] [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This type is retained only for compatibility. The recommended alternative is string.Create (int length, TState state, System.Buffers.SpanAction action).", error: true)] @@ -17,6 +20,10 @@ public struct InplaceStringBuilder private int _capacity; private string? _value; + /// + /// Initializes a new instance of the class. + /// + /// The suggested starting size of the instance. public InplaceStringBuilder(int capacity) : this() { if (capacity < 0) @@ -27,6 +34,9 @@ public InplaceStringBuilder(int capacity) : this() _capacity = capacity; } + /// + /// Gets the number of characters that the current object can contain. + /// public int Capacity { get => _capacity; @@ -47,6 +57,10 @@ public int Capacity } } + /// + /// Appends a string to the end of the current instance. + /// + /// The string to append. public void Append(string? value) { if (value == null) @@ -57,11 +71,21 @@ public void Append(string? value) Append(value, 0, value.Length); } + /// + /// Appends a string segment to the end of the current instance. + /// + /// The string segment to append. public void Append(StringSegment segment) { Append(segment.Buffer, segment.Offset, segment.Length); } + /// + /// Appends a substring to the end of the current instance. + /// + /// The string that contains the substring to append. + /// The starting position of the substring within value. + /// The number of characters in value to append. [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void Append(string? value, int offset, int count) { @@ -83,6 +107,10 @@ public unsafe void Append(string? value, int offset, int count) } } + /// + /// Appends a character to the end of the current instance. + /// + /// The character to append. [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe void Append(char c) { @@ -99,6 +127,10 @@ public unsafe void Append(char c) } } + /// + /// Converts the value of this instance to a String. + /// + /// A string whose value is the same as this instance. public override string? ToString() { if (Capacity != _offset) diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/StringSegmentComparer.cs b/src/libraries/Microsoft.Extensions.Primitives/src/StringSegmentComparer.cs index 5d8883061711c..9942f7959f5bd 100644 --- a/src/libraries/Microsoft.Extensions.Primitives/src/StringSegmentComparer.cs +++ b/src/libraries/Microsoft.Extensions.Primitives/src/StringSegmentComparer.cs @@ -32,11 +32,23 @@ private StringSegmentComparer(StringComparison comparison, StringComparer compar private StringComparison Comparison { get; } private StringComparer Comparer { get; } + /// + /// Compares two objects and returns an indication of their relative sort order. + /// + /// The first to compare. + /// The second to compare. + /// A 32-bit signed integer that indicates the lexical relationship between the two comparands. public int Compare(StringSegment x, StringSegment y) { return StringSegment.Compare(x, y, Comparison); } + /// + /// Determines whether two objects are equal. + /// + /// The first to compare. + /// The second to compare. + /// if the two objects are equal; otherwise, . public bool Equals(StringSegment x, StringSegment y) { return StringSegment.Equals(x, y, Comparison); diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/StringTokenizer.cs b/src/libraries/Microsoft.Extensions.Primitives/src/StringTokenizer.cs index 3ce726f5f09f0..9c4c19cfb542b 100644 --- a/src/libraries/Microsoft.Extensions.Primitives/src/StringTokenizer.cs +++ b/src/libraries/Microsoft.Extensions.Primitives/src/StringTokenizer.cs @@ -96,14 +96,24 @@ public Enumerator(ref StringTokenizer tokenizer) _index = 0; } + /// + /// Gets the current from the . + /// public StringSegment Current { get; private set; } object IEnumerator.Current => Current; + /// + /// Releases all resources used by the . + /// public void Dispose() { } + /// + /// Advances the enumerator to the next token in the . + /// + /// if the enumerator was successfully advanced to the next token; if the enumerator has passed the end of the . public bool MoveNext() { if (!_value.HasValue || _index > _value.Length) @@ -125,6 +135,9 @@ public bool MoveNext() return true; } + /// + /// Resets the to its initial state. + /// public void Reset() { Current = default(StringSegment); diff --git a/src/libraries/Microsoft.Extensions.Primitives/src/StringValues.cs b/src/libraries/Microsoft.Extensions.Primitives/src/StringValues.cs index e1536501e33d1..87320cbf06472 100644 --- a/src/libraries/Microsoft.Extensions.Primitives/src/StringValues.cs +++ b/src/libraries/Microsoft.Extensions.Primitives/src/StringValues.cs @@ -788,6 +788,10 @@ internal Enumerator(object? value) public Enumerator(ref StringValues values) : this(values._values) { } + /// + /// Advances the enumerator to the next element of the . + /// + /// if the enumerator was successfully advanced to the next element; if the enumerator has passed the end of the . public bool MoveNext() { int index = _index; @@ -814,6 +818,9 @@ public bool MoveNext() return _current != null; } + /// + /// Gets the element at the current position of the enumerator. + /// public string? Current => _current; object? IEnumerator.Current => _current; @@ -823,6 +830,9 @@ void IEnumerator.Reset() throw new NotSupportedException(); } + /// + /// Releases all resources used by the . + /// public void Dispose() { } diff --git a/src/libraries/Microsoft.Internal.Runtime.DotNetApiDocs.Transport/src/Microsoft.Internal.Runtime.DotNetApiDocs.Transport.proj b/src/libraries/Microsoft.Internal.Runtime.DotNetApiDocs.Transport/src/Microsoft.Internal.Runtime.DotNetApiDocs.Transport.proj new file mode 100644 index 0000000000000..bd89ab444b618 --- /dev/null +++ b/src/libraries/Microsoft.Internal.Runtime.DotNetApiDocs.Transport/src/Microsoft.Internal.Runtime.DotNetApiDocs.Transport.proj @@ -0,0 +1,55 @@ + + + + $(NetCoreAppCurrent)-$(TargetOS) + false + + false + true + true + false + false + true + Internal transport package to provide dotnet-api-docs with the reference assemblies and compiler generated documentation files from dotnet/runtime. + $(NoWarn);NU5128;NU5131 + false + $(TargetsForTfmSpecificContentInPackage);IncludeProjectReferenceCompilerGeneratedSecondaryOutputInPackage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/libraries/System.Formats.Cbor/src/System.Formats.Cbor.csproj b/src/libraries/System.Formats.Cbor/src/System.Formats.Cbor.csproj index 0757a3e86d021..829d96e5b6e10 100644 --- a/src/libraries/System.Formats.Cbor/src/System.Formats.Cbor.csproj +++ b/src/libraries/System.Formats.Cbor/src/System.Formats.Cbor.csproj @@ -1,9 +1,10 @@ + $(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) true true - false + true Provides classes that can read and write the CBOR data format. Commonly Used Types: @@ -60,4 +61,5 @@ System.Formats.Cbor.CborWriter + diff --git a/src/libraries/System.Speech/src/System.Speech.csproj b/src/libraries/System.Speech/src/System.Speech.csproj index a06ca783311a3..54065e0bbe6dc 100644 --- a/src/libraries/System.Speech/src/System.Speech.csproj +++ b/src/libraries/System.Speech/src/System.Speech.csproj @@ -1,4 +1,5 @@ + $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);$(NetCoreAppPrevious)-windows;$(NetCoreAppPrevious);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum);netstandard2.0 true @@ -7,8 +8,8 @@ $(NoWarn);CS0649;SA1129;IDE0059;IDE0060;CA1822;CA1852 annotations false - - $(NoWarn);1591 + + false true true true @@ -256,4 +257,5 @@ System.Speech.Recognition.SpeechRecognizer + diff --git a/src/libraries/oob-all.proj b/src/libraries/oob-all.proj index 8233bcac0bd86..07b063fab4094 100644 --- a/src/libraries/oob-all.proj +++ b/src/libraries/oob-all.proj @@ -23,7 +23,8 @@ diff --git a/src/libraries/oob-src.proj b/src/libraries/oob-src.proj index a285e8a83cf24..bb571ebc35f19 100644 --- a/src/libraries/oob-src.proj +++ b/src/libraries/oob-src.proj @@ -32,7 +32,8 @@ + Microsoft.Internal.Runtime.WindowsDesktop.Transport\src\Microsoft.Internal.Runtime.WindowsDesktop.Transport.proj; + Microsoft.Internal.Runtime.DotNetApiDocs.Transport\src\Microsoft.Internal.Runtime.DotNetApiDocs.Transport.proj" />