From 914ad9b3c6fdd6543dec89ce705a5a060f244471 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Tue, 16 Mar 2021 08:30:32 -0700 Subject: [PATCH] Update to 5.2xx SDK (#19216) --- CONTRIBUTING.md | 2 +- eng/Directory.Build.Data.props | 2 +- .../templates/steps/install-dotnet.yml | 26 +++++++++---------- global.json | 2 +- .../src/Spatial/SpatialFormatter.cs | 6 +++++ .../src/BatchConstants.cs | 2 ++ .../src/LazyLoadingBlobStream.cs | 8 +++--- .../src/Models/BlobChangeFeedEventType.cs | 16 +++++++++--- .../src/Models/BlobOperationName.cs | 16 +++++++++--- .../tests/LazyLoadingBlobStreamTests.cs | 8 +++--- .../src/BlobQuickQueryStream.cs | 2 +- .../src/Models/ContentRange.cs | 4 ++- .../tests/BlobBaseClientTests.cs | 10 +++---- .../Models/ClientSideEncryptionAlgorithm.cs | 4 ++- .../src/Shared/LazyLoadingReadOnlyStream.cs | 19 +++++++------- .../src/Shared/StorageWriteStream.cs | 10 +++---- .../tests/FileClientTests.cs | 10 +++---- .../tests/FileClientTests.cs | 12 ++++----- .../src/Azure.Storage.Queues.csproj | 2 ++ ...re.WebJobs.Extensions.Storage.Blobs.csproj | 2 ++ ...e.WebJobs.Extensions.Storage.Queues.csproj | 2 ++ 21 files changed, 101 insertions(+), 64 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1ff21a3c453f..d380684838fd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,7 +9,7 @@ - Install VS 2019 (Community or higher) and make sure you have the latest updates (https://www.visualstudio.com/). - Need at least .NET Framework 4.6.1 and 4.7 development tools - Install the **.NET Core cross-platform development** workloads in VisualStudio -- Install **.NET Core 5.0.100 SDK** for your specific platform. (or a higher version within the 5.0.*** band) (https://dotnet.microsoft.com/download/dotnet-core/5.0) +- Install **.NET Core 5.0.200 SDK** for your specific platform. (or a higher version within the 5.0.*** band) (https://dotnet.microsoft.com/download/dotnet-core/5.0) - Install the latest version of git (https://git-scm.com/downloads) - Install [PowerShell](https://docs.microsoft.com/powershell/scripting/install/installing-powershell), version 6 or higher, if you plan to make public API changes or are working with generated code snippets. - Install [NodeJS](https://nodejs.org/) (14.x.x) if you plan to use [C# code generation](https://github.com/Azure/autorest.csharp). diff --git a/eng/Directory.Build.Data.props b/eng/Directory.Build.Data.props index 2286d7cedae5..29e6bb12a9af 100644 --- a/eng/Directory.Build.Data.props +++ b/eng/Directory.Build.Data.props @@ -55,7 +55,7 @@ true $(AZURE_DEV_UPDATESOURCESONBUILD) pwsh - true + true private diff --git a/eng/pipelines/templates/steps/install-dotnet.yml b/eng/pipelines/templates/steps/install-dotnet.yml index 8ffad3412646..4637bbd3250e 100644 --- a/eng/pipelines/templates/steps/install-dotnet.yml +++ b/eng/pipelines/templates/steps/install-dotnet.yml @@ -1,15 +1,15 @@ # All required SDKs/runtimes are available on DevOps agents -steps: [] +#steps: [] # Installation steps need to be uncommented when switching to a newer SDK that's not available on DevOps agents -#steps: -# - task: UseDotNet@2 -# displayName: 'Use .NET Core SDK' -# inputs: -# useGlobalJson: true -# performMultiLevelLookup: true -# - task: UseDotNet@2 -# condition: ne(variables['Agent.OS'], 'Windows_NT') # Windows supports MultiLevelLookup and doesn't need explicit framework installation -# displayName: 'Use .NET Core 2.1 runtime' -# inputs: -# packageType: runtime -# version: "2.1.x" +steps: + - task: UseDotNet@2 + displayName: 'Use .NET Core SDK' + inputs: + useGlobalJson: true + performMultiLevelLookup: true + - task: UseDotNet@2 + condition: ne(variables['Agent.OS'], 'Windows_NT') # Windows supports MultiLevelLookup and doesn't need explicit framework installation + displayName: 'Use .NET Core 2.1 runtime' + inputs: + packageType: runtime + version: "2.1.x" diff --git a/global.json b/global.json index 0047897c25ff..8ec079bafb63 100644 --- a/global.json +++ b/global.json @@ -3,7 +3,7 @@ "Microsoft.Build.Traversal": "1.0.45" }, "sdk": { - "version": "5.0.100", + "version": "5.0.200", "rollForward": "feature" } } \ No newline at end of file diff --git a/sdk/search/Azure.Search.Documents/src/Spatial/SpatialFormatter.cs b/sdk/search/Azure.Search.Documents/src/Spatial/SpatialFormatter.cs index 6142434187b8..102b7101bcb5 100644 --- a/sdk/search/Azure.Search.Documents/src/Spatial/SpatialFormatter.cs +++ b/sdk/search/Azure.Search.Documents/src/Spatial/SpatialFormatter.cs @@ -131,15 +131,19 @@ public static string EncodePolygon(GeographyLineStringProxy line) if (line.Points.Count < 4) { +#pragma warning disable CA2208 // Instantiate argument exceptions correctly throw new ArgumentException( $"A GeographyLineString must have at least four Points to form a searchable polygon.", $"{nameof(line)}.{nameof(line.Points)}"); +#pragma warning restore CA2208 // Instantiate argument exceptions correctly } else if (line.Points[0] != line.Points[line.Points.Count - 1]) { +#pragma warning disable CA2208 // Instantiate argument exceptions correctly throw new ArgumentException( $"A GeographyLineString must have matching first and last Points to form a searchable polygon.", $"{nameof(line)}.{nameof(line.Points)}"); +#pragma warning restore CA2208 // Instantiate argument exceptions correctly } StringBuilder odata = new StringBuilder("geography'POLYGON(("); @@ -180,9 +184,11 @@ public static string EncodePolygon(GeographyPolygonProxy polygon) if (polygon.Rings.Count != 1) { +#pragma warning disable CA2208 // Instantiate argument exceptions correctly throw new ArgumentException( $"A GeographyPolygon must have exactly one Rings to form a searchable polygon.", $"{nameof(polygon)}.{nameof(polygon.Rings)}"); +#pragma warning restore CA2208 // Instantiate argument exceptions correctly } return EncodePolygon(polygon.Rings[0]); diff --git a/sdk/storage/Azure.Storage.Blobs.Batch/src/BatchConstants.cs b/sdk/storage/Azure.Storage.Blobs.Batch/src/BatchConstants.cs index cfb448c8967f..58335c28cdaf 100644 --- a/sdk/storage/Azure.Storage.Blobs.Batch/src/BatchConstants.cs +++ b/sdk/storage/Azure.Storage.Blobs.Batch/src/BatchConstants.cs @@ -25,6 +25,8 @@ internal static class BatchConstants public const string BatchSeparator = "--"; public const string HttpVersion = "HTTP/1.1"; +#pragma warning disable CA1802 // Use literals where appropriate public static readonly string DelayedResponsePropertyName = $"{nameof(BlobBatchClient)}.{nameof(BlobBatchClient.SubmitBatch)}:DelayedResponse"; +#pragma warning restore CA1802 // Use literals where appropriate } } diff --git a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/LazyLoadingBlobStream.cs b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/LazyLoadingBlobStream.cs index 60c491de2c6d..d87a7f28b94b 100644 --- a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/LazyLoadingBlobStream.cs +++ b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/LazyLoadingBlobStream.cs @@ -173,22 +173,22 @@ private static void ValidateReadParameters(byte[] buffer, int offset, int count) if (offset < 0) { - throw new ArgumentOutOfRangeException($"{nameof(offset)} cannot be less than 0."); + throw new ArgumentOutOfRangeException(nameof(offset), $"{nameof(offset)} cannot be less than 0."); } if (offset > buffer.Length) { - throw new ArgumentOutOfRangeException($"{nameof(offset)} cannot exceed {nameof(buffer)} length."); + throw new ArgumentOutOfRangeException(nameof(offset), $"{nameof(offset)} cannot exceed {nameof(buffer)} length."); } if (count < 0) { - throw new ArgumentOutOfRangeException($"{nameof(count)} cannot be less than 0."); + throw new ArgumentOutOfRangeException(nameof(count), $"{nameof(count)} cannot be less than 0."); } if (offset + count > buffer.Length) { - throw new ArgumentOutOfRangeException($"{nameof(offset)} + {nameof(count)} cannot exceed {nameof(buffer)} length."); + throw new ArgumentOutOfRangeException(nameof(count), $"{nameof(offset)} + {nameof(count)} cannot exceed {nameof(buffer)} length."); } } diff --git a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Models/BlobChangeFeedEventType.cs b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Models/BlobChangeFeedEventType.cs index 37ce0077b504..24f487646a9e 100644 --- a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Models/BlobChangeFeedEventType.cs +++ b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Models/BlobChangeFeedEventType.cs @@ -58,13 +58,23 @@ namespace Azure.Storage.Blobs.ChangeFeed /// public static BlobChangeFeedEventType BlobAsyncOperationInitiated { get; } = new BlobChangeFeedEventType("BlobAsyncOperationInitiated"); - /// + /// + /// Compares equality of two instances. + /// + /// The to compare. + /// The to compare to. + /// true if values of both BlobChangeFeedEventType are equal, otherwise false. public static bool operator ==(BlobChangeFeedEventType left, BlobChangeFeedEventType right) => left.Equals(right); - /// + /// + /// Compares inequality of two instances. + /// + /// The to compare. + /// The to compare to. + /// true if values of both BlobChangeFeedEventType are not equal, otherwise false. public static bool operator !=(BlobChangeFeedEventType left, BlobChangeFeedEventType right) => !left.Equals(right); - /// + /// Converts a string to a . public static implicit operator BlobChangeFeedEventType(string value) => new BlobChangeFeedEventType(value); /// diff --git a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Models/BlobOperationName.cs b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Models/BlobOperationName.cs index 0f0fabf280a9..f169a46a0100 100644 --- a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Models/BlobOperationName.cs +++ b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Models/BlobOperationName.cs @@ -79,13 +79,23 @@ namespace Azure.Storage.Blobs.ChangeFeed /// public static BlobOperationName AbortCopyBlob { get; } = new BlobOperationName("AbortCopyBlob"); - /// + /// + /// Compares equality of two instances. + /// + /// The to compare. + /// The to compare to. + /// true if values of both BlobOperationName are equal, otherwise false. public static bool operator ==(BlobOperationName left, BlobOperationName right) => left.Equals(right); - /// + /// + /// Compares inequality of two instances. + /// + /// The to compare. + /// The to compare to. + /// true if values of both BlobOperationName are not equal, otherwise false. public static bool operator !=(BlobOperationName left, BlobOperationName right) => !left.Equals(right); - /// + /// Converts a string to a . public static implicit operator BlobOperationName(string value) => new BlobOperationName(value); /// diff --git a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/tests/LazyLoadingBlobStreamTests.cs b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/tests/LazyLoadingBlobStreamTests.cs index b6f799183a71..037b31617080 100644 --- a/sdk/storage/Azure.Storage.Blobs.ChangeFeed/tests/LazyLoadingBlobStreamTests.cs +++ b/sdk/storage/Azure.Storage.Blobs.ChangeFeed/tests/LazyLoadingBlobStreamTests.cs @@ -72,19 +72,19 @@ await TestHelper.AssertExpectedExceptionAsync( await TestHelper.AssertExpectedExceptionAsync( lazyStream.ReadAsync(buffer: new byte[10], offset: -1, count: 10), - new ArgumentOutOfRangeException("offset cannot be less than 0.", $"Specified argument was out of the range of valid values.")); + new ArgumentOutOfRangeException("offset", "offset cannot be less than 0.")); await TestHelper.AssertExpectedExceptionAsync( lazyStream.ReadAsync(buffer: new byte[10], offset: 11, count: 10), - new ArgumentOutOfRangeException("offset cannot exceed buffer length.", $"Specified argument was out of the range of valid values.")); + new ArgumentOutOfRangeException("offset", "offset cannot exceed buffer length.")); await TestHelper.AssertExpectedExceptionAsync( lazyStream.ReadAsync(buffer: new byte[10], offset: 1, count: -1), - new ArgumentOutOfRangeException("count cannot be less than 0.", $"Specified argument was out of the range of valid values.")); + new ArgumentOutOfRangeException("count", "count cannot be less than 0.")); await TestHelper.AssertExpectedExceptionAsync( lazyStream.ReadAsync(buffer: new byte[10], offset: 5, count: 15), - new ArgumentOutOfRangeException("offset + count cannot exceed buffer length.", $"Specified argument was out of the range of valid values.")); + new ArgumentOutOfRangeException("count", "offset + count cannot exceed buffer length.")); } } } diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobQuickQueryStream.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobQuickQueryStream.cs index fd13556a1022..d52316aa4524 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobQuickQueryStream.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobQuickQueryStream.cs @@ -69,7 +69,7 @@ public BlobQuickQueryStream( public override int Read(byte[] buffer, int offset, int count) => ReadInternal(async: false, buffer, offset, count).EnsureCompleted(); - /// + /// public new async Task ReadAsync(byte[] buffer, int offset, int count) => await ReadInternal(async: true, buffer, offset, count).ConfigureAwait(false); diff --git a/sdk/storage/Azure.Storage.Blobs/src/Models/ContentRange.cs b/sdk/storage/Azure.Storage.Blobs/src/Models/ContentRange.cs index fe5f6fb914c1..a2e62bc7816f 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Models/ContentRange.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Models/ContentRange.cs @@ -59,7 +59,9 @@ public RangeUnit(string value) [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is RangeUnit other && Equals(other); - /// + /// + /// Indicates whether this instance and a specified are equal + /// public bool Equals(RangeUnit other) => string.Equals(_value, other._value, StringComparison.Ordinal); /// diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs index 1e0ccfc5bf26..195f681763a5 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/BlobBaseClientTests.cs @@ -1977,15 +1977,15 @@ await TestHelper.AssertExpectedExceptionAsync( await TestHelper.AssertExpectedExceptionAsync( stream.ReadAsync(buffer: new byte[10], offset: -1, count: 10), - new ArgumentOutOfRangeException("offset cannot be less than 0.", "Specified argument was out of the range of valid values.")); + new ArgumentOutOfRangeException("offset", "offset cannot be less than 0.")); await TestHelper.AssertExpectedExceptionAsync( stream.ReadAsync(buffer: new byte[10], offset: 11, count: 10), - new ArgumentOutOfRangeException("offset cannot exceed buffer length.", "Specified argument was out of the range of valid values.")); + new ArgumentOutOfRangeException("offset", "offset cannot exceed buffer length.")); await TestHelper.AssertExpectedExceptionAsync( stream.ReadAsync(buffer: new byte[10], offset: 1, count: -1), - new ArgumentOutOfRangeException("count cannot be less than 0.", "Specified argument was out of the range of valid values.")); + new ArgumentOutOfRangeException("count", "count cannot be less than 0.")); } [Test] @@ -2030,7 +2030,7 @@ public async Task OpenReadAsync_Seek_NegativeNewPosition() Stream outputStream = await blob.OpenReadAsync().ConfigureAwait(false); TestHelper.AssertExpectedException( () => outputStream.Seek(-10, SeekOrigin.Begin), - new ArgumentException("New offset cannot be less than 0. Value was -10")); + new ArgumentException("New offset cannot be less than 0. Value was -10", "offset")); } [Test] @@ -2053,7 +2053,7 @@ public async Task OpenReadAsync_Seek_NewPositionGreaterThanBlobLength(bool allow Stream outputStream = await blob.OpenReadAsync(options).ConfigureAwait(false); TestHelper.AssertExpectedException( () => outputStream.Seek(1025, SeekOrigin.Begin), - new ArgumentException("You cannot seek past the last known length of the underlying blob or file.")); + new ArgumentException("You cannot seek past the last known length of the underlying blob or file.", "offset")); Assert.AreEqual(size, outputStream.Length); } diff --git a/sdk/storage/Azure.Storage.Common/src/Shared/ClientsideEncryption/Models/ClientSideEncryptionAlgorithm.cs b/sdk/storage/Azure.Storage.Common/src/Shared/ClientsideEncryption/Models/ClientSideEncryptionAlgorithm.cs index f54bacc82a6c..3ec3792b5567 100644 --- a/sdk/storage/Azure.Storage.Common/src/Shared/ClientsideEncryption/Models/ClientSideEncryptionAlgorithm.cs +++ b/sdk/storage/Azure.Storage.Common/src/Shared/ClientsideEncryption/Models/ClientSideEncryptionAlgorithm.cs @@ -55,7 +55,9 @@ public ClientSideEncryptionAlgorithm(string value) [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is ClientSideEncryptionAlgorithm other && Equals(other); - /// + /// + /// Indicates whether this instance and a specified are equal + /// public bool Equals(ClientSideEncryptionAlgorithm other) => string.Equals(_value, other._value, StringComparison.Ordinal); /// diff --git a/sdk/storage/Azure.Storage.Common/src/Shared/LazyLoadingReadOnlyStream.cs b/sdk/storage/Azure.Storage.Common/src/Shared/LazyLoadingReadOnlyStream.cs index 98e501736c96..fcfa7c167a88 100644 --- a/sdk/storage/Azure.Storage.Common/src/Shared/LazyLoadingReadOnlyStream.cs +++ b/sdk/storage/Azure.Storage.Common/src/Shared/LazyLoadingReadOnlyStream.cs @@ -233,17 +233,17 @@ private static void ValidateReadParameters(byte[] buffer, int offset, int count) if (offset < 0) { - throw new ArgumentOutOfRangeException($"{nameof(offset)} cannot be less than 0."); + throw new ArgumentOutOfRangeException(nameof(offset), $"{nameof(offset)} cannot be less than 0."); } if (offset > buffer.Length) { - throw new ArgumentOutOfRangeException($"{nameof(offset)} cannot exceed {nameof(buffer)} length."); + throw new ArgumentOutOfRangeException(nameof(offset), $"{nameof(offset)} cannot exceed {nameof(buffer)} length."); } if (count < 0) { - throw new ArgumentOutOfRangeException($"{nameof(count)} cannot be less than 0."); + throw new ArgumentOutOfRangeException(nameof(count), $"{nameof(count)} cannot be less than 0."); } } @@ -268,7 +268,7 @@ private async Task GetBlobLengthInternal(bool async, CancellationToken can if (lengthString == null) { - throw new ArgumentException($"{HttpHeader.Names.ContentLength} header is mssing on get properties response."); + throw new ArgumentException($"{HttpHeader.Names.ContentLength} header is missing on get properties response."); } return Convert.ToInt64(lengthString, CultureInfo.InvariantCulture); @@ -280,7 +280,7 @@ private static long GetBlobLengthFromResponse(Response response) if (lengthString == null) { - throw new ArgumentException("Content-Range header is mssing on download response."); + throw new ArgumentException("Content-Range header is missing on download response."); } string[] split = lengthString.Split('/'); @@ -332,14 +332,13 @@ public override long Seek(long offset, SeekOrigin origin) // newPosition < 0 if (newPosition < 0) { - throw new ArgumentException($"New {nameof(offset)} cannot be less than 0. Value was {newPosition}"); + throw new ArgumentException($"New {nameof(offset)} cannot be less than 0. Value was {newPosition}", nameof(offset)); } // newPosition > _length if (newPosition > _length) { - throw new ArgumentException( - "You cannot seek past the last known length of the underlying blob or file."); + throw new ArgumentException("You cannot seek past the last known length of the underlying blob or file.", nameof(offset)); } // newPosition is less than _position, but within _buffer. @@ -377,14 +376,14 @@ internal long CalculateNewPosition(long offset, SeekOrigin origin) case SeekOrigin.End: if (_allowBlobModifications) { - throw new ArgumentException($"Cannot {nameof(Seek)} with {nameof(SeekOrigin)}.{nameof(SeekOrigin.End)} on a growing blob or file. Call Stream.Seek(Stream.Length, SeekOrigin.Begin) to get to the end of known data."); + throw new ArgumentException($"Cannot {nameof(Seek)} with {nameof(SeekOrigin)}.{nameof(SeekOrigin.End)} on a growing blob or file. Call Stream.Seek(Stream.Length, SeekOrigin.Begin) to get to the end of known data.", nameof(origin)); } else { return _length + offset; } default: - throw new ArgumentException($"Unknown ${nameof(SeekOrigin)} value"); + throw new ArgumentException($"Unknown ${nameof(SeekOrigin)} value", nameof(origin)); } } diff --git a/sdk/storage/Azure.Storage.Common/src/Shared/StorageWriteStream.cs b/sdk/storage/Azure.Storage.Common/src/Shared/StorageWriteStream.cs index 0f8228a5bf6b..c49ef99a1955 100644 --- a/sdk/storage/Azure.Storage.Common/src/Shared/StorageWriteStream.cs +++ b/sdk/storage/Azure.Storage.Common/src/Shared/StorageWriteStream.cs @@ -183,27 +183,27 @@ protected static void ValidateWriteParameters(byte[] buffer, int offset, int cou { if (buffer == null) { - throw new ArgumentNullException($"{nameof(buffer)}", $"{nameof(buffer)} cannot be null."); + throw new ArgumentNullException(nameof(buffer), $"{nameof(buffer)} cannot be null."); } if (offset < 0) { - throw new ArgumentOutOfRangeException($"{nameof(offset)} cannot be less than 0."); + throw new ArgumentOutOfRangeException(nameof(offset), $"{nameof(offset)} cannot be less than 0."); } if (offset > buffer.Length) { - throw new ArgumentOutOfRangeException($"{nameof(offset)} cannot be greater than {nameof(buffer)} length."); + throw new ArgumentOutOfRangeException(nameof(offset), $"{nameof(offset)} cannot be greater than {nameof(buffer)} length."); } if (count < 0) { - throw new ArgumentOutOfRangeException($"{nameof(count)} cannot be less than 0."); + throw new ArgumentOutOfRangeException(nameof(count), $"{nameof(count)} cannot be less than 0."); } if (offset + count > buffer.Length) { - throw new ArgumentOutOfRangeException($"{nameof(offset)} + {nameof(count)} cannot exceed {nameof(buffer)} length."); + throw new ArgumentOutOfRangeException(nameof(count), $"{nameof(offset)} + {nameof(count)} cannot exceed {nameof(buffer)} length."); } } diff --git a/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs b/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs index 35477734f2ee..c179a4d17caf 100644 --- a/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.DataLake/tests/FileClientTests.cs @@ -4212,15 +4212,15 @@ await TestHelper.AssertExpectedExceptionAsync( await TestHelper.AssertExpectedExceptionAsync( stream.ReadAsync(buffer: new byte[10], offset: -1, count: 10), - new ArgumentOutOfRangeException("offset cannot be less than 0.", "Specified argument was out of the range of valid values.")); + new ArgumentOutOfRangeException("offset", "offset cannot be less than 0.")); await TestHelper.AssertExpectedExceptionAsync( stream.ReadAsync(buffer: new byte[10], offset: 11, count: 10), - new ArgumentOutOfRangeException("offset cannot exceed buffer length.", "Specified argument was out of the range of valid values.")); + new ArgumentOutOfRangeException("offset", "offset cannot exceed buffer length.")); await TestHelper.AssertExpectedExceptionAsync( stream.ReadAsync(buffer: new byte[10], offset: 1, count: -1), - new ArgumentOutOfRangeException("count cannot be less than 0.", "Specified argument was out of the range of valid values.")); + new ArgumentOutOfRangeException("count", "count cannot be less than 0.")); } [Test] @@ -4265,7 +4265,7 @@ public async Task OpenReadAsync_Seek_NegativeNewPosition() Stream outputStream = await file.OpenReadAsync().ConfigureAwait(false); TestHelper.AssertExpectedException( () => outputStream.Seek(-10, SeekOrigin.Begin), - new ArgumentException("New offset cannot be less than 0. Value was -10")); + new ArgumentException("New offset cannot be less than 0. Value was -10", "offset")); } [Test] @@ -4288,7 +4288,7 @@ public async Task OpenReadAsync_Seek_NewPositionGreaterThanFileLength(bool allow Stream outputStream = await file.OpenReadAsync(options: options).ConfigureAwait(false); TestHelper.AssertExpectedException( () => outputStream.Seek(size + 10, SeekOrigin.Begin), - new ArgumentException("You cannot seek past the last known length of the underlying blob or file.")); + new ArgumentException("You cannot seek past the last known length of the underlying blob or file.", "offset")); Assert.AreEqual(size, outputStream.Length); } diff --git a/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs b/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs index cef5da9f19b9..e9b843a91bdd 100644 --- a/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs +++ b/sdk/storage/Azure.Storage.Files.Shares/tests/FileClientTests.cs @@ -3405,19 +3405,19 @@ public async Task OpenReadAsync_InvalidParameterTests() // Act await TestHelper.AssertExpectedExceptionAsync( stream.ReadAsync(buffer: null, offset: 0, count: 10), - new ArgumentNullException("buffer", "buffer cannot be null.")); + new ArgumentNullException("buffer", $"buffer cannot be null.")); await TestHelper.AssertExpectedExceptionAsync( stream.ReadAsync(buffer: new byte[10], offset: -1, count: 10), - new ArgumentOutOfRangeException("offset cannot be less than 0.", $"Specified argument was out of the range of valid values.")); + new ArgumentOutOfRangeException("offset", "offset cannot be less than 0.")); await TestHelper.AssertExpectedExceptionAsync( stream.ReadAsync(buffer: new byte[10], offset: 11, count: 10), - new ArgumentOutOfRangeException("offset cannot exceed buffer length.", "Specified argument was out of the range of valid values.")); + new ArgumentOutOfRangeException("offset", "offset cannot exceed buffer length.")); await TestHelper.AssertExpectedExceptionAsync( stream.ReadAsync(buffer: new byte[10], offset: 1, count: -1), - new ArgumentOutOfRangeException("count cannot be less than 0.", "Specified argument was out of the range of valid values.")); + new ArgumentOutOfRangeException("count", "count cannot be less than 0.")); } [Test] @@ -3464,7 +3464,7 @@ public async Task OpenReadAsync_Seek_NegativeNewPosition() Stream outputStream = await file.OpenReadAsync().ConfigureAwait(false); TestHelper.AssertExpectedException( () => outputStream.Seek(-10, SeekOrigin.Begin), - new ArgumentException("New offset cannot be less than 0. Value was -10")); + new ArgumentException("New offset cannot be less than 0. Value was -10", "offset")); } [Test] @@ -3488,7 +3488,7 @@ public async Task OpenReadAsync_Seek_NewPositionGreaterThanFileLength(bool allow Stream outputStream = await file.OpenReadAsync(options: options).ConfigureAwait(false); TestHelper.AssertExpectedException( () => outputStream.Seek(size + 10, SeekOrigin.Begin), - new ArgumentException("You cannot seek past the last known length of the underlying blob or file.")); + new ArgumentException("You cannot seek past the last known length of the underlying blob or file.", "offset")); Assert.AreEqual(size, outputStream.Length); } diff --git a/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj b/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj index 83d2f040a853..c7c5549782f1 100644 --- a/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj +++ b/sdk/storage/Azure.Storage.Queues/src/Azure.Storage.Queues.csproj @@ -16,6 +16,8 @@ Microsoft Azure Storage REST API Reference - https://docs.microsoft.com/en-us/rest/api/storageservices/ REST API Reference for Queue Service - https://docs.microsoft.com/en-us/rest/api/storageservices/queue-service-rest-api + + $(NoWarn);IDT002;IDT003 diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/src/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.csproj b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/src/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.csproj index 79ec98c50449..16379d2dcfaf 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/src/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.csproj +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/src/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.csproj @@ -5,6 +5,8 @@ 5.0.0-beta.4 This extension adds bindings for Storage + + $(NoWarn);IDT002;IDT003 diff --git a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/src/Microsoft.Azure.WebJobs.Extensions.Storage.Queues.csproj b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/src/Microsoft.Azure.WebJobs.Extensions.Storage.Queues.csproj index 9a41c0c38d3f..334cbb53fa8f 100644 --- a/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/src/Microsoft.Azure.WebJobs.Extensions.Storage.Queues.csproj +++ b/sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Queues/src/Microsoft.Azure.WebJobs.Extensions.Storage.Queues.csproj @@ -5,6 +5,8 @@ 5.0.0-beta.4 This extension adds bindings for Storage + + $(NoWarn);IDT002