From 2a8703c2f738576314eea49f897e380ceddbba1f Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Wed, 20 Jul 2022 15:04:32 -0700 Subject: [PATCH 1/4] Do not fail tests immediately - combine `RegexReplace` into `PrintTestRunSummary` task - remove unused `WarnOnNoMatch` parameter; inline other parameters - capture test summary in `msbuild` logs - avoid `System.Console` use in the task - fail task if any tests fail - collect `xunit` task exit codes in case of catastrophic problems (not test failures) - fail build if `PrintTestRunSummary` doesn't but errors occurred also: - do not test assemblies in parallel; reduce port contention issues - avoid `CallTarget` task nits: - clean some trailing whitespace in C# sources - mostly files I expect to update soon - reduce `NuGet.exe restore` verbosity; no longer debugging that - add console summary when using build.cmd - reduce duplication in `RestorePackages` target - only restore NetCore projects when `$(BuildPortable)` is `true` - restore src NetStandard project transitively through NetStandard.Test project - pass more properties w/ `Restore` target invocation --- Runtime.msbuild | 31 ++-- build.cmd | 6 +- src/Common/CollectionExtensions.cs | 8 +- src/Common/CommonWebApiResources.Designer.cs | 24 +-- src/Common/Error.cs | 2 +- .../ByteRangeStreamContent.cs | 28 +-- .../Formatting/BufferedMediaTypeFormatter.cs | 8 +- .../Formatting/DefaultContentNegotiator.cs | 14 +- .../Formatting/FormDataCollection.cs | 18 +- .../Formatting/FormUrlEncodedJson.cs | 18 +- .../FormUrlEncodedMediaTypeFormatter.cs | 6 +- .../Formatting/JsonMediaTypeFormatter.cs | 2 +- .../Formatting/MediaTypeFormatter.cs | 4 +- .../MediaTypeHeaderValueExtensions.cs | 12 +- ...MediaTypeWithQualityHeaderValueComparer.cs | 6 +- .../Formatting/ParsedMediaTypeHeaderValue.cs | 12 +- .../Parsers/FormUrlEncodedParser.cs | 6 +- .../Parsers/HttpRequestLineParser.cs | 4 +- .../Parsers/HttpStatusLineParser.cs | 4 +- .../Parsers/MimeMultipartBodyPartParser.cs | 14 +- .../Formatting/Parsers/MimeMultipartParser.cs | 30 ++-- .../Formatting/RequestHeaderMapping.cs | 10 +- .../StringWithQualityHeaderValueComparer.cs | 6 +- .../Formatting/XmlMediaTypeFormatter.cs | 6 +- .../FormattingUtilities.cs | 4 +- .../Handlers/ProgressStream.cs | 2 +- .../HttpContentFormDataExtensions.cs | 2 +- .../HttpContentMessageExtensions.cs | 8 +- .../HttpContentMultipartExtensions.cs | 8 +- .../HttpMessageContent.cs | 2 +- .../Internal/HttpValueCollection.cs | 2 +- .../MimeBodyPart.cs | 4 +- .../MultipartRelatedStreamProvider.cs | 4 +- .../Properties/Resources.Designer.cs | 162 +++++++++--------- .../ApplicationParts/ApplicationPartTest.cs | 6 +- tools/WebStack.tasks.targets | 107 +++++------- tools/WebStack.xunit.targets | 29 ++-- 37 files changed, 299 insertions(+), 320 deletions(-) diff --git a/Runtime.msbuild b/Runtime.msbuild index 2e785ab2e..4999f6a4f 100644 --- a/Runtime.msbuild +++ b/Runtime.msbuild @@ -11,7 +11,7 @@ true true false - $(BuildInParallel) + false $(MSBuildThisFileDirectory)bin\$(Configuration)\test\TestResults\ $(MSBuildThisFileDirectory)packages\Microsoft.Web.SkipStrongNames.1.0.0\tools\SkipStrongNames.exe $(MSBuildThisFileDirectory)tools\SkipStrongNames.xml @@ -65,25 +65,24 @@ - <_NuGetPackagesAndSolutions Include="src\System.Net.Http.Formatting.NetCore\packages.config; - test\System.Net.Http.Formatting.NetCore.Test\packages.config; - Runtime.sln" /> + <_NuGetPackagesAndSolutions Include="Runtime.sln" /> <_NuGetPackagesAndSolutions Include="src\System.Net.Http.Formatting.NetCore\packages.config; test\System.Net.Http.Formatting.NetCore.Test\packages.config" Condition=" '$(BuildPortable)' == 'true' " /> - <_ProjectsToRestore Include="src\System.Net.Http.Formatting.NetStandard\System.Net.Http.Formatting.NetStandard.csproj; - test\System.Net.Http.Formatting.NetStandard.Test\System.Net.Http.Formatting.NetStandard.Test.csproj" + <_ProjectsToRestore Include="test\System.Net.Http.Formatting.NetStandard.Test\System.Net.Http.Formatting.NetStandard.Test.csproj" Condition=" '$(BuildPortable)' == 'true' " /> - + -Verbosity quiet -ConfigFile "$(MSBuildThisFileDirectory)\.nuget\NuGet.Config"' /> + @@ -110,9 +109,7 @@ Properties="Configuration=$(Configuration);CodeAnalysis=$(CodeAnalysis);StyleCopEnabled=$(StyleCopEnabled);VisualStudioVersion=$(VisualStudioVersion)" /> - - - + @@ -128,7 +125,9 @@ - + + + - + + + + diff --git a/build.cmd b/build.cmd index a5ca225d4..5a6a4f8f9 100644 --- a/build.cmd +++ b/build.cmd @@ -40,12 +40,14 @@ if exist "%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe" ( if "%1" == "" goto BuildDefaults -%MSBuild% Runtime.msbuild /m /nr:false /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal /t:%* +%MSBuild% Runtime.msbuild /m /nr:false /p:Platform="Any CPU" /p:Desktop=true /v:M ^ + /fl /fileLoggerParameters:LogFile=bin\msbuild.log;Verbosity=Normal /consoleLoggerParameters:Summary /t:%* if %ERRORLEVEL% neq 0 goto BuildFail goto BuildSuccess :BuildDefaults -%MSBuild% Runtime.msbuild /m /nr:false /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal +%MSBuild% Runtime.msbuild /m /nr:false /p:Platform="Any CPU" /p:Desktop=true /v:M ^ + /fl /fileLoggerParameters:LogFile=bin\msbuild.log;Verbosity=Normal /consoleLoggerParameters:Summary if %ERRORLEVEL% neq 0 goto BuildFail goto BuildSuccess diff --git a/src/Common/CollectionExtensions.cs b/src/Common/CollectionExtensions.cs index c89d4ad98..bfd1eb61d 100644 --- a/src/Common/CollectionExtensions.cs +++ b/src/Common/CollectionExtensions.cs @@ -27,7 +27,7 @@ public static T[] AppendAndReallocate(this T[] array, T value) } /// - /// Return the enumerable as an Array, copying if required. Optimized for common case where it is an Array. + /// Return the enumerable as an Array, copying if required. Optimized for common case where it is an Array. /// Avoid mutating the return value. /// public static T[] AsArray(this IEnumerable values) @@ -43,7 +43,7 @@ public static T[] AsArray(this IEnumerable values) } /// - /// Return the enumerable as a Collection of T, copying if required. Optimized for the common case where it is + /// Return the enumerable as a Collection of T, copying if required. Optimized for the common case where it is /// a Collection of T and avoiding a copy if it implements IList of T. Avoid mutating the return value. /// public static Collection AsCollection(this IEnumerable enumerable) @@ -78,9 +78,9 @@ public static IList AsIList(this IEnumerable enumerable) } return new List(enumerable); } - + /// - /// Return the enumerable as a List of T, copying if required. Optimized for common case where it is an List of T + /// Return the enumerable as a List of T, copying if required. Optimized for common case where it is an List of T /// or a ListWrapperCollection of T. Avoid mutating the return value. /// public static List AsList(this IEnumerable enumerable) diff --git a/src/Common/CommonWebApiResources.Designer.cs b/src/Common/CommonWebApiResources.Designer.cs index 4ceb3f115..251eed2b4 100644 --- a/src/Common/CommonWebApiResources.Designer.cs +++ b/src/Common/CommonWebApiResources.Designer.cs @@ -24,15 +24,15 @@ namespace System.Web.Http.Properties { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class CommonWebApiResources { - + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal CommonWebApiResources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// @@ -59,7 +59,7 @@ internal CommonWebApiResources() { return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. @@ -73,7 +73,7 @@ internal CommonWebApiResources() { resourceCulture = value; } } - + /// /// Looks up a localized string similar to Relative URI values are not supported: '{0}'. The URI must be absolute.. /// @@ -82,7 +82,7 @@ internal static string ArgumentInvalidAbsoluteUri { return ResourceManager.GetString("ArgumentInvalidAbsoluteUri", resourceCulture); } } - + /// /// Looks up a localized string similar to Unsupported URI scheme: '{0}'. The URI scheme must be either '{1}' or '{2}'.. /// @@ -91,7 +91,7 @@ internal static string ArgumentInvalidHttpUriScheme { return ResourceManager.GetString("ArgumentInvalidHttpUriScheme", resourceCulture); } } - + /// /// Looks up a localized string similar to Value must be greater than or equal to {0}.. /// @@ -100,7 +100,7 @@ internal static string ArgumentMustBeGreaterThanOrEqualTo { return ResourceManager.GetString("ArgumentMustBeGreaterThanOrEqualTo", resourceCulture); } } - + /// /// Looks up a localized string similar to Value must be less than or equal to {0}.. /// @@ -109,7 +109,7 @@ internal static string ArgumentMustBeLessThanOrEqualTo { return ResourceManager.GetString("ArgumentMustBeLessThanOrEqualTo", resourceCulture); } } - + /// /// Looks up a localized string similar to The argument '{0}' is null or empty.. /// @@ -118,7 +118,7 @@ internal static string ArgumentNullOrEmpty { return ResourceManager.GetString("ArgumentNullOrEmpty", resourceCulture); } } - + /// /// Looks up a localized string similar to URI must not contain a query component or a fragment identifier.. /// @@ -127,7 +127,7 @@ internal static string ArgumentUriHasQueryOrFragment { return ResourceManager.GetString("ArgumentUriHasQueryOrFragment", resourceCulture); } } - + /// /// Looks up a localized string similar to The value of argument '{0}' ({1}) is invalid for Enum type '{2}'.. /// diff --git a/src/Common/Error.cs b/src/Common/Error.cs index 0e8c83465..b6013c5dc 100644 --- a/src/Common/Error.cs +++ b/src/Common/Error.cs @@ -74,7 +74,7 @@ internal static ArgumentException ArgumentUriNotAbsolute(string parameterName, U } /// - /// Creates an with a message saying that the argument must be an absolute URI + /// Creates an with a message saying that the argument must be an absolute URI /// without a query or fragment identifier and then logs it with . /// /// The name of the parameter that caused the current exception. diff --git a/src/System.Net.Http.Formatting/ByteRangeStreamContent.cs b/src/System.Net.Http.Formatting/ByteRangeStreamContent.cs index 587a0fd7f..40edaddb8 100644 --- a/src/System.Net.Http.Formatting/ByteRangeStreamContent.cs +++ b/src/System.Net.Http.Formatting/ByteRangeStreamContent.cs @@ -13,8 +13,8 @@ namespace System.Net.Http { /// /// implementation which provides a byte range view over a stream used to generate HTTP - /// 206 (Partial Content) byte range responses. The supports one or more - /// byte ranges regardless of whether the ranges are consecutive or not. If there is only one range then a + /// 206 (Partial Content) byte range responses. The supports one or more + /// byte ranges regardless of whether the ranges are consecutive or not. If there is only one range then a /// single partial response body containing a Content-Range header is generated. If there are more than one /// ranges then a multipart/byteranges response is generated where each body part contains a range indicated /// by the associated Content-Range header field. @@ -33,9 +33,9 @@ public class ByteRangeStreamContent : HttpContent /// /// implementation which provides a byte range view over a stream used to generate HTTP - /// 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend - /// of the selected resource represented by the parameter then an - /// is thrown indicating the valid Content-Range of the content. + /// 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend + /// of the selected resource represented by the parameter then an + /// is thrown indicating the valid Content-Range of the content. /// /// The stream over which to generate a byte range view. /// The range or ranges, typically obtained from the Range HTTP request header field. @@ -47,9 +47,9 @@ public ByteRangeStreamContent(Stream content, RangeHeaderValue range, string med /// /// implementation which provides a byte range view over a stream used to generate HTTP - /// 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend - /// of the selected resource represented by the parameter then an - /// is thrown indicating the valid Content-Range of the content. + /// 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend + /// of the selected resource represented by the parameter then an + /// is thrown indicating the valid Content-Range of the content. /// /// The stream over which to generate a byte range view. /// The range or ranges, typically obtained from the Range HTTP request header field. @@ -62,9 +62,9 @@ public ByteRangeStreamContent(Stream content, RangeHeaderValue range, string med /// /// implementation which provides a byte range view over a stream used to generate HTTP - /// 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend - /// of the selected resource represented by the parameter then an - /// is thrown indicating the valid Content-Range of the content. + /// 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend + /// of the selected resource represented by the parameter then an + /// is thrown indicating the valid Content-Range of the content. /// /// The stream over which to generate a byte range view. /// The range or ranges, typically obtained from the Range HTTP request header field. @@ -76,9 +76,9 @@ public ByteRangeStreamContent(Stream content, RangeHeaderValue range, MediaTypeH /// /// implementation which provides a byte range view over a stream used to generate HTTP - /// 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend - /// of the selected resource represented by the parameter then an - /// is thrown indicating the valid Content-Range of the content. + /// 206 (Partial Content) byte range responses. If none of the requested ranges overlap with the current extend + /// of the selected resource represented by the parameter then an + /// is thrown indicating the valid Content-Range of the content. /// /// The stream over which to generate a byte range view. /// The range or ranges, typically obtained from the Range HTTP request header field. diff --git a/src/System.Net.Http.Formatting/Formatting/BufferedMediaTypeFormatter.cs b/src/System.Net.Http.Formatting/Formatting/BufferedMediaTypeFormatter.cs index 29554fd07..908ba6221 100644 --- a/src/System.Net.Http.Formatting/Formatting/BufferedMediaTypeFormatter.cs +++ b/src/System.Net.Http.Formatting/Formatting/BufferedMediaTypeFormatter.cs @@ -13,7 +13,7 @@ namespace System.Net.Http.Formatting { /// - /// Base class for writing a synchronous formatter on top of the asynchronous formatter infrastructure. + /// Base class for writing a synchronous formatter on top of the asynchronous formatter infrastructure. /// This does not guarantee non-blocking threads. The only way to guarantee that we don't block a thread on IO is /// to use the asynchronous . /// @@ -219,13 +219,13 @@ private static Stream GetBufferStream(Stream innerStream, int bufferSize) { Contract.Assert(innerStream != null); - // We wrap the inner stream in a non-closing delegating stream so that we allow the user + // We wrap the inner stream in a non-closing delegating stream so that we allow the user // to use the using (...) pattern yet not break the contract of formatters not closing // the inner stream. Stream nonClosingStream = new NonClosingDelegatingStream(innerStream); - // This uses a naive buffering. BufferedStream() will block the thread while it drains the buffer. - // We can explore a smarter implementation that async drains the buffer. + // This uses a naive buffering. BufferedStream() will block the thread while it drains the buffer. + // We can explore a smarter implementation that async drains the buffer. return new BufferedStream(nonClosingStream, bufferSize); } } diff --git a/src/System.Net.Http.Formatting/Formatting/DefaultContentNegotiator.cs b/src/System.Net.Http.Formatting/Formatting/DefaultContentNegotiator.cs index 94b0f9b99..0cf5c36d7 100644 --- a/src/System.Net.Http.Formatting/Formatting/DefaultContentNegotiator.cs +++ b/src/System.Net.Http.Formatting/Formatting/DefaultContentNegotiator.cs @@ -95,7 +95,7 @@ public virtual ContentNegotiationResult Negotiate(Type type, HttpRequestMessage /// /// Determine how well each formatter matches by associating a value - /// with the formatter. Then associate the quality of the match based on q-factors and other parameters. The result of this + /// with the formatter. Then associate the quality of the match based on q-factors and other parameters. The result of this /// method is a collection of the matches found categorized and assigned a quality value. /// /// The type to be serialized. @@ -123,7 +123,7 @@ protected virtual Collection ComputeFormatterMatches(Ty // Go through each formatter to find how well it matches. ListWrapperCollection matches = new ListWrapperCollection(); MediaTypeFormatter[] writingFormatters = GetWritingFormatters(formatters); - for (int i = 0; i < writingFormatters.Length; i++) + for (int i = 0; i < writingFormatters.Length; i++) { MediaTypeFormatter formatter = writingFormatters[i]; MediaTypeFormatterMatch match = null; @@ -161,7 +161,7 @@ protected virtual Collection ComputeFormatterMatches(Ty continue; } - // Check whether we should match on type or stop the matching process. + // Check whether we should match on type or stop the matching process. // The latter is used to generate 406 (Not Acceptable) status codes. bool shouldMatchOnType = ShouldMatchOnType(sortedAcceptValues); @@ -459,7 +459,7 @@ protected virtual MediaTypeFormatterMatch MatchRequestMediaType(HttpRequestMessa /// /// Determine whether to match on type or not. This is used to determine whether to /// generate a 406 response or use the default media type formatter in case there - /// is no match against anything in the request. If ExcludeMatchOnTypeOnly is true + /// is no match against anything in the request. If ExcludeMatchOnTypeOnly is true /// then we don't match on type unless there are no accept headers. /// /// The sorted accept header values to match. @@ -504,7 +504,7 @@ protected virtual MediaTypeFormatterMatch MatchType(Type type, MediaTypeFormatte } /// - /// Sort Accept header values and related header field values with similar syntax rules + /// Sort Accept header values and related header field values with similar syntax rules /// (if more than 1) in descending order based on q-factor. /// /// The header values to sort. @@ -529,7 +529,7 @@ protected virtual IEnumerable SortMediaTypeWith } /// - /// Sort Accept-Charset, Accept-Encoding, Accept-Language and related header field values with similar syntax rules + /// Sort Accept-Charset, Accept-Encoding, Accept-Language and related header field values with similar syntax rules /// (if more than 1) in descending order based on q-factor. /// /// The header values to sort. @@ -554,7 +554,7 @@ protected virtual IEnumerable SortStringWithQualit } /// - /// Evaluates whether a match is better than the current match and if so returns the replacement; otherwise returns the + /// Evaluates whether a match is better than the current match and if so returns the replacement; otherwise returns the /// current match. /// protected virtual MediaTypeFormatterMatch UpdateBestMatch(MediaTypeFormatterMatch current, MediaTypeFormatterMatch potentialReplacement) diff --git a/src/System.Net.Http.Formatting/Formatting/FormDataCollection.cs b/src/System.Net.Http.Formatting/Formatting/FormDataCollection.cs index 21504147b..17ce38c8e 100644 --- a/src/System.Net.Http.Formatting/Formatting/FormDataCollection.cs +++ b/src/System.Net.Http.Formatting/Formatting/FormDataCollection.cs @@ -21,9 +21,9 @@ namespace System.Net.Http.Formatting { /// /// Represent the form data. - /// - This has 100% fidelity (including ordering, which is important for deserializing ordered array). - /// - using interfaces allows us to optimize the implementation. E.g., we can avoid eagerly string-splitting a 10gb file. - /// - This also provides a convenient place to put extension methods. + /// - This has 100% fidelity (including ordering, which is important for deserializing ordered array). + /// - using interfaces allows us to optimize the implementation. E.g., we can avoid eagerly string-splitting a 10gb file. + /// - This also provides a convenient place to put extension methods. /// #if NETFX_CORE internal @@ -37,8 +37,8 @@ class FormDataCollection : IEnumerable> private NameValueCollection _nameValueCollection; /// - /// Initialize a form collection around incoming data. - /// The key value enumeration should be immutable. + /// Initialize a form collection around incoming data. + /// The key value enumeration should be immutable. /// /// incoming set of key value pairs. Ordering is preserved. [SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures", Justification = "This is the convention for representing FormData")] @@ -52,8 +52,8 @@ public FormDataCollection(IEnumerable> pairs) } /// - /// Initialize a form collection from a query string. - /// Uri and FormURl body have the same schema. + /// Initialize a form collection from a query string. + /// Uri and FormURl body have the same schema. /// public FormDataCollection(Uri uri) { @@ -136,7 +136,7 @@ public NameValueCollection ReadAsNameValueCollection() } /// - /// Get values associated with a given key. If there are multiple values, they're concatenated. + /// Get values associated with a given key. If there are multiple values, they're concatenated. /// public string Get(string key) { @@ -144,7 +144,7 @@ public string Get(string key) } /// - /// Get a value associated with a given key. + /// Get a value associated with a given key. /// public string[] GetValues(string key) { diff --git a/src/System.Net.Http.Formatting/Formatting/FormUrlEncodedJson.cs b/src/System.Net.Http.Formatting/Formatting/FormUrlEncodedJson.cs index 6a295c72c..cb3d53917 100644 --- a/src/System.Net.Http.Formatting/Formatting/FormUrlEncodedJson.cs +++ b/src/System.Net.Http.Formatting/Formatting/FormUrlEncodedJson.cs @@ -13,9 +13,9 @@ namespace System.Net.Http.Formatting { /// - /// This class provides a low-level API for parsing HTML form URL-encoded data, also known as application/x-www-form-urlencoded - /// data. The output of the parser is a instance. - /// This is a low-level API intended for use by other APIs. It has been optimized for performance and + /// This class provides a low-level API for parsing HTML form URL-encoded data, also known as application/x-www-form-urlencoded + /// data. The output of the parser is a instance. + /// This is a low-level API intended for use by other APIs. It has been optimized for performance and /// is not intended to be called directly from user code. /// internal static class FormUrlEncodedJson @@ -31,7 +31,7 @@ internal static class FormUrlEncodedJson /// /// Parses a collection of query string values as a . /// - /// This is a low-level API intended for use by other APIs. It has been optimized for performance and + /// This is a low-level API intended for use by other APIs. It has been optimized for performance and /// is not intended to be called directly from user code. /// The collection of query string name-value pairs parsed in lexical order. Both names /// and values must be un-escaped so that they don't contain any encoding. @@ -44,7 +44,7 @@ public static JObject Parse(IEnumerable> nameValueP /// /// Parses a collection of query string values as a . /// - /// This is a low-level API intended for use by other APIs. It has been optimized for performance and + /// This is a low-level API intended for use by other APIs. It has been optimized for performance and /// is not intended to be called directly from user code. /// The collection of query string name-value pairs parsed in lexical order. Both names /// and values must be un-escaped so that they don't contain any encoding. @@ -58,7 +58,7 @@ public static JObject Parse(IEnumerable> nameValueP /// /// Parses a collection of query string values as a . /// - /// This is a low-level API intended for use by other APIs. It has been optimized for performance and + /// This is a low-level API intended for use by other APIs. It has been optimized for performance and /// is not intended to be called directly from user code. /// The collection of query string name-value pairs parsed in lexical order. Both names /// and values must be un-escaped so that they don't contain any encoding. @@ -72,7 +72,7 @@ public static bool TryParse(IEnumerable> nameValueP /// /// Parses a collection of query string values as a . /// - /// This is a low-level API intended for use by other APIs. It has been optimized for performance and + /// This is a low-level API intended for use by other APIs. It has been optimized for performance and /// is not intended to be called directly from user code. /// The collection of query string name-value pairs parsed in lexical order. Both names /// and values must be un-escaped so that they don't contain any encoding. @@ -87,7 +87,7 @@ public static bool TryParse(IEnumerable> nameValueP /// /// Parses a collection of query string values as a . /// - /// This is a low-level API intended for use by other APIs. It has been optimized for performance and + /// This is a low-level API intended for use by other APIs. It has been optimized for performance and /// is not intended to be called directly from user code. /// The collection of query string name-value pairs parsed in lexical order. Both names /// and values must be un-escaped so that they don't contain any encoding. @@ -112,7 +112,7 @@ private static JObject ParseInternal(IEnumerable> n string key = nameValuePair.Key; string value = nameValuePair.Value; - // value is preserved, even if it's null, "undefined", "null", String.Empty, etc when converting to JToken. + // value is preserved, even if it's null, "undefined", "null", String.Empty, etc when converting to JToken. if (key == null) { diff --git a/src/System.Net.Http.Formatting/Formatting/FormUrlEncodedMediaTypeFormatter.cs b/src/System.Net.Http.Formatting/Formatting/FormUrlEncodedMediaTypeFormatter.cs index 994ab173b..5c8d883af 100644 --- a/src/System.Net.Http.Formatting/Formatting/FormUrlEncodedMediaTypeFormatter.cs +++ b/src/System.Net.Http.Formatting/Formatting/FormUrlEncodedMediaTypeFormatter.cs @@ -13,7 +13,7 @@ namespace System.Net.Http.Formatting { /// - /// class for handling HTML form URL-ended data, also known as application/x-www-form-urlencoded. + /// class for handling HTML form URL-ended data, also known as application/x-www-form-urlencoded. /// public class FormUrlEncodedMediaTypeFormatter : MediaTypeFormatter { @@ -119,7 +119,7 @@ public override bool CanReadType(Type type) throw Error.ArgumentNull("type"); } - // Can't read arbitrary types. + // Can't read arbitrary types. return type == typeof(FormDataCollection) || FormattingUtilities.IsJTokenType(type); } @@ -193,7 +193,7 @@ private object ReadFromStream(Type type, Stream readStream) } /// - /// Reads all name-value pairs encoded as HTML Form URL encoded data and add them to + /// Reads all name-value pairs encoded as HTML Form URL encoded data and add them to /// a collection as UNescaped URI strings. /// /// Stream to read from. diff --git a/src/System.Net.Http.Formatting/Formatting/JsonMediaTypeFormatter.cs b/src/System.Net.Http.Formatting/Formatting/JsonMediaTypeFormatter.cs index 019c8feb2..23b2908bb 100644 --- a/src/System.Net.Http.Formatting/Formatting/JsonMediaTypeFormatter.cs +++ b/src/System.Net.Http.Formatting/Formatting/JsonMediaTypeFormatter.cs @@ -95,7 +95,7 @@ public static MediaTypeHeaderValue DefaultMediaType #endif /// - /// Gets or sets a value indicating whether to indent elements when writing data. + /// Gets or sets a value indicating whether to indent elements when writing data. /// public bool Indent { get; set; } diff --git a/src/System.Net.Http.Formatting/Formatting/MediaTypeFormatter.cs b/src/System.Net.Http.Formatting/Formatting/MediaTypeFormatter.cs index dd7731e1d..367fba74a 100644 --- a/src/System.Net.Http.Formatting/Formatting/MediaTypeFormatter.cs +++ b/src/System.Net.Http.Formatting/Formatting/MediaTypeFormatter.cs @@ -79,7 +79,7 @@ protected MediaTypeFormatter(MediaTypeFormatter formatter) } /// - /// Gets or sets the maximum number of keys stored in a NameValueCollection. + /// Gets or sets the maximum number of keys stored in a NameValueCollection. /// public static int MaxHttpCollectionKeys { @@ -117,7 +117,7 @@ internal List SupportedMediaTypesInternal /// /// Gets the mutable collection of character encodings supported by /// this instance. The encodings are - /// used when reading or writing data. + /// used when reading or writing data. /// public Collection SupportedEncodings { get; private set; } diff --git a/src/System.Net.Http.Formatting/Formatting/MediaTypeHeaderValueExtensions.cs b/src/System.Net.Http.Formatting/Formatting/MediaTypeHeaderValueExtensions.cs index a0cae45d0..7f58a0d18 100644 --- a/src/System.Net.Http.Formatting/Formatting/MediaTypeHeaderValueExtensions.cs +++ b/src/System.Net.Http.Formatting/Formatting/MediaTypeHeaderValueExtensions.cs @@ -17,8 +17,8 @@ internal static class MediaTypeHeaderValueExtensions /// /// Determines whether two instances match. The instance /// is said to match if and only if - /// is a strict subset of the values and parameters of . - /// That is, if the media type and media type parameters of are all present + /// is a strict subset of the values and parameters of . + /// That is, if the media type and media type parameters of are all present /// and match those of then it is a match even though may have additional /// parameters. /// @@ -34,8 +34,8 @@ public static bool IsSubsetOf(this MediaTypeHeaderValue mediaType1, MediaTypeHea /// /// Determines whether two instances match. The instance /// is said to match if and only if - /// is a strict subset of the values and parameters of . - /// That is, if the media type and media type parameters of are all present + /// is a strict subset of the values and parameters of . + /// That is, if the media type and media type parameters of are all present /// and match those of then it is a match even though may have additional /// parameters. /// @@ -75,12 +75,12 @@ public static bool IsSubsetOf(this MediaTypeHeaderValue mediaType1, MediaTypeHea } } - // So far we either have a full match or a subset match. Now check that all of + // So far we either have a full match or a subset match. Now check that all of // mediaType1's parameters are present and equal in mediatype2 // Optimize for the common case where the parameters inherit from Collection and cache the count which is faster for Collection. Collection parameters1 = mediaType1.Parameters.AsCollection(); int parameterCount1 = parameters1.Count; - Collection parameters2 = mediaType2.Parameters.AsCollection(); + Collection parameters2 = mediaType2.Parameters.AsCollection(); int parameterCount2 = parameters2.Count; for (int i = 0; i < parameterCount1; i++) { diff --git a/src/System.Net.Http.Formatting/Formatting/MediaTypeWithQualityHeaderValueComparer.cs b/src/System.Net.Http.Formatting/Formatting/MediaTypeWithQualityHeaderValueComparer.cs index 549d2272f..277759254 100644 --- a/src/System.Net.Http.Formatting/Formatting/MediaTypeWithQualityHeaderValueComparer.cs +++ b/src/System.Net.Http.Formatting/Formatting/MediaTypeWithQualityHeaderValueComparer.cs @@ -8,7 +8,7 @@ namespace System.Net.Http.Formatting { /// Implementation of that can compare accept media type header fields - /// based on their quality values (a.k.a q-values). See + /// based on their quality values (a.k.a q-values). See /// for a comparer for other content negotiation /// header field q-values. internal class MediaTypeWithQualityHeaderValueComparer : IComparer @@ -26,8 +26,8 @@ public static MediaTypeWithQualityHeaderValueComparer QualityComparer /// /// Compares two based on their quality value (a.k.a their "q-value"). - /// Values with identical q-values are considered equal (i.e the result is 0) with the exception that sub-type wild-cards are - /// considered less than specific media types and full wild-cards are considered less than sub-type wild-cards. This allows to + /// Values with identical q-values are considered equal (i.e the result is 0) with the exception that sub-type wild-cards are + /// considered less than specific media types and full wild-cards are considered less than sub-type wild-cards. This allows to /// sort a sequence of following their q-values in the order of specific media types, /// sub-type wildcards, and last any full wild-cards. /// diff --git a/src/System.Net.Http.Formatting/Formatting/ParsedMediaTypeHeaderValue.cs b/src/System.Net.Http.Formatting/Formatting/ParsedMediaTypeHeaderValue.cs index 057730391..fa1e4c259 100644 --- a/src/System.Net.Http.Formatting/Formatting/ParsedMediaTypeHeaderValue.cs +++ b/src/System.Net.Http.Formatting/Formatting/ParsedMediaTypeHeaderValue.cs @@ -40,14 +40,14 @@ public ParsedMediaTypeHeaderValue(MediaTypeHeaderValue mediaTypeHeaderValue) } } - public bool IsAllMediaRange - { - get { return _isAllMediaRange; } + public bool IsAllMediaRange + { + get { return _isAllMediaRange; } } - public bool IsSubtypeMediaRange - { - get { return _isSubtypeMediaRange; } + public bool IsSubtypeMediaRange + { + get { return _isSubtypeMediaRange; } } public bool TypesEqual(ref ParsedMediaTypeHeaderValue other) diff --git a/src/System.Net.Http.Formatting/Formatting/Parsers/FormUrlEncodedParser.cs b/src/System.Net.Http.Formatting/Formatting/Parsers/FormUrlEncodedParser.cs index d7f248d16..6a4f42024 100644 --- a/src/System.Net.Http.Formatting/Formatting/Parsers/FormUrlEncodedParser.cs +++ b/src/System.Net.Http.Formatting/Formatting/Parsers/FormUrlEncodedParser.cs @@ -11,7 +11,7 @@ namespace System.Net.Http.Formatting.Parsers { /// - /// Buffer-oriented parsing of HTML form URL-ended, also known as application/x-www-form-urlencoded, data. + /// Buffer-oriented parsing of HTML form URL-ended, also known as application/x-www-form-urlencoded, data. /// internal class FormUrlEncodedParser { @@ -54,7 +54,7 @@ private enum NameValueState /// /// Parse a buffer of URL form-encoded name-value pairs and add them to the collection. - /// Bytes are parsed in a consuming manner from the beginning of the buffer meaning that the same bytes can not be + /// Bytes are parsed in a consuming manner from the beginning of the buffer meaning that the same bytes can not be /// present in the buffer. /// /// Buffer from where data is read @@ -243,7 +243,7 @@ private ParserState CopyCurrent(ParserState parseState) } /// - /// Maintains information about the current header field being parsed. + /// Maintains information about the current header field being parsed. /// private class CurrentNameValuePair { diff --git a/src/System.Net.Http.Formatting/Formatting/Parsers/HttpRequestLineParser.cs b/src/System.Net.Http.Formatting/Formatting/Parsers/HttpRequestLineParser.cs index 027270150..b89189f8a 100644 --- a/src/System.Net.Http.Formatting/Formatting/Parsers/HttpRequestLineParser.cs +++ b/src/System.Net.Http.Formatting/Formatting/Parsers/HttpRequestLineParser.cs @@ -56,8 +56,8 @@ private enum HttpRequestLineState } /// - /// Parse an HTTP request line. - /// Bytes are parsed in a consuming manner from the beginning of the request buffer meaning that the same bytes can not be + /// Parse an HTTP request line. + /// Bytes are parsed in a consuming manner from the beginning of the request buffer meaning that the same bytes can not be /// present in the request buffer. /// /// Request buffer from where request is read diff --git a/src/System.Net.Http.Formatting/Formatting/Parsers/HttpStatusLineParser.cs b/src/System.Net.Http.Formatting/Formatting/Parsers/HttpStatusLineParser.cs index e64677e94..86f00f77d 100644 --- a/src/System.Net.Http.Formatting/Formatting/Parsers/HttpStatusLineParser.cs +++ b/src/System.Net.Http.Formatting/Formatting/Parsers/HttpStatusLineParser.cs @@ -58,8 +58,8 @@ private enum HttpStatusLineState } /// - /// Parse an HTTP status line. - /// Bytes are parsed in a consuming manner from the beginning of the response buffer meaning that the same bytes can not be + /// Parse an HTTP status line. + /// Bytes are parsed in a consuming manner from the beginning of the response buffer meaning that the same bytes can not be /// present in the response buffer. /// /// Response buffer from where response is read diff --git a/src/System.Net.Http.Formatting/Formatting/Parsers/MimeMultipartBodyPartParser.cs b/src/System.Net.Http.Formatting/Formatting/Parsers/MimeMultipartBodyPartParser.cs index 24981c209..4f135c6ed 100644 --- a/src/System.Net.Http.Formatting/Formatting/Parsers/MimeMultipartBodyPartParser.cs +++ b/src/System.Net.Http.Formatting/Formatting/Parsers/MimeMultipartBodyPartParser.cs @@ -11,7 +11,7 @@ namespace System.Net.Http.Formatting.Parsers { /// - /// Complete MIME multipart parser that combines for parsing the MIME message into individual body parts + /// Complete MIME multipart parser that combines for parsing the MIME message into individual body parts /// and for parsing each body part into a MIME header and a MIME body. The caller of the parser is returned /// the resulting MIME bodies which can then be written to some output. /// @@ -104,7 +104,7 @@ public void Dispose() } /// - /// Parses the data provided and generates parsed MIME body part bodies in the form of which are ready to + /// Parses the data provided and generates parsed MIME body part bodies in the form of which are ready to /// write to the output stream. /// /// The data to parse @@ -116,11 +116,11 @@ public IEnumerable ParseBuffer(byte[] data, int bytesRead) bool isFinal = false; // There's a special case here - if we've reached the end of the message and there's no optional - // CRLF, then we're out of bytes to read, but we have finished the message. + // CRLF, then we're out of bytes to read, but we have finished the message. // - // If IsWaitingForEndOfMessage is true and we're at the end of the stream, then we're going to - // call into the parser again with an empty array as the buffer to signal the end of the parse. - // Then the final boundary segment will be marked as complete. + // If IsWaitingForEndOfMessage is true and we're at the end of the stream, then we're going to + // call into the parser again with an empty array as the buffer to signal the end of the parse. + // Then the final boundary segment will be marked as complete. if (bytesRead == 0 && !_mimeParser.IsWaitingForEndOfMessage) { CleanupCurrentBodyPart(); @@ -195,7 +195,7 @@ public IEnumerable ParseBuffer(byte[] data, int bytesRead) } else { - // Otherwise return what we have + // Otherwise return what we have yield return _currentBodyPart; } } diff --git a/src/System.Net.Http.Formatting/Formatting/Parsers/MimeMultipartParser.cs b/src/System.Net.Http.Formatting/Formatting/Parsers/MimeMultipartParser.cs index 734124566..40b83e617 100644 --- a/src/System.Net.Http.Formatting/Formatting/Parsers/MimeMultipartParser.cs +++ b/src/System.Net.Http.Formatting/Formatting/Parsers/MimeMultipartParser.cs @@ -122,7 +122,7 @@ public enum State /// DataTooBig, } - + public bool CanParseMore(int bytesRead, int bytesConsumed) { if (bytesConsumed < bytesRead) @@ -147,7 +147,7 @@ public bool CanParseMore(int bytesRead, int bytesConsumed) /// /// Parse a MIME multipart message. Bytes are parsed in a consuming - /// manner from the beginning of the request buffer meaning that the same bytes can not be + /// manner from the beginning of the request buffer meaning that the same bytes can not be /// present in the request buffer. /// /// Request buffer from where request is read @@ -156,7 +156,7 @@ public bool CanParseMore(int bytesRead, int bytesConsumed) /// Any body part that was considered as a potential MIME multipart boundary but which was in fact part of the body. /// The bulk of the body part. /// Indicates whether the final body part has been found. - /// In order to get the complete body part, the caller is responsible for concatenating the contents of the + /// In order to get the complete body part, the caller is responsible for concatenating the contents of the /// and out parameters. /// State of the parser. [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "Exception is translated to parse state.")] @@ -375,7 +375,7 @@ private static State ParseBodyPart( goto quit; } } - + if (bytesConsumed > segmentStart) { if (!currentBodyPart.AppendBoundary(buffer, segmentStart, bytesConsumed - segmentStart)) @@ -391,7 +391,7 @@ private static State ParseBodyPart( case BodyPartState.AfterBoundary: // This state means that we just saw the end of a boundary. It might by a 'normal' boundary, in which - // case it's followed by optional whitespace and a CRLF. Or it might be the 'final' boundary and will + // case it's followed by optional whitespace and a CRLF. Or it might be the 'final' boundary and will // be followed by '--', optional whitespace and an optional CRLF. if (buffer[bytesConsumed] == MimeMultipartParser.Dash && !currentBodyPart.IsFinal) { @@ -456,13 +456,13 @@ private static State ParseBodyPart( { currentBodyPart.AppendBoundary(MimeMultipartParser.Dash); bytesConsumed++; - + if (currentBodyPart.IsBoundaryComplete()) { Debug.Assert(currentBodyPart.IsFinal); - // If we get in here, it means we've see the trailing '--' of the last boundary - in order to consume all of the - // remaining bytes, we don't mark the parse as complete again - wait until this method is called again with the + // If we get in here, it means we've see the trailing '--' of the last boundary - in order to consume all of the + // remaining bytes, we don't mark the parse as complete again - wait until this method is called again with the // empty buffer to do that. bodyPartState = BodyPartState.AfterBoundary; parseStatus = State.NeedMoreData; @@ -658,9 +658,9 @@ public void AppendBoundary(byte data) /// The number of bytes to append. public bool AppendBoundary(byte[] data, int offset, int count) { - // Check that potential boundary is not bigger than our reference boundary. - // Allow for 2 extra characters to include the final boundary which ends with - // an additional "--" sequence + plus up to 4 LWS characters (which are allowed). + // Check that potential boundary is not bigger than our reference boundary. + // Allow for 2 extra characters to include the final boundary which ends with + // an additional "--" sequence + plus up to 4 LWS characters (which are allowed). if (_boundaryLength + count > _referenceBoundaryLength + 6) { return false; @@ -753,7 +753,7 @@ public bool IsBoundaryComplete() { return false; } - + if (_boundaryLength < _referenceBoundaryLength) { return false; @@ -797,9 +797,9 @@ private string DebuggerToString() var boundary = Encoding.UTF8.GetString(_boundary, 0, _boundaryLength); return String.Format( - CultureInfo.InvariantCulture, - "Expected: {0} *** Current: {1}", - referenceBoundary, + CultureInfo.InvariantCulture, + "Expected: {0} *** Current: {1}", + referenceBoundary, boundary); } } diff --git a/src/System.Net.Http.Formatting/Formatting/RequestHeaderMapping.cs b/src/System.Net.Http.Formatting/Formatting/RequestHeaderMapping.cs index 3deee8ca3..845d8903d 100644 --- a/src/System.Net.Http.Formatting/Formatting/RequestHeaderMapping.cs +++ b/src/System.Net.Http.Formatting/Formatting/RequestHeaderMapping.cs @@ -23,9 +23,9 @@ public class RequestHeaderMapping : MediaTypeMapping /// Name of the header to match. /// The header value to match. /// The value comparison to use when matching . - /// if set to true then is + /// if set to true then is /// considered a match if it matches a substring of the actual header value. - /// The media type to use if and + /// The media type to use if and /// is considered a match. public RequestHeaderMapping(string headerName, string headerValue, StringComparison valueComparison, bool isValueSubstring, string mediaType) : base(mediaType) @@ -39,9 +39,9 @@ public RequestHeaderMapping(string headerName, string headerValue, StringCompari /// Name of the header to match. /// The header value to match. /// The to use when matching . - /// if set to true then is + /// if set to true then is /// considered a match if it matches a substring of the actual header value. - /// The to use if and + /// The to use if and /// is considered a match. public RequestHeaderMapping(string headerName, string headerValue, StringComparison valueComparison, bool isValueSubstring, MediaTypeHeaderValue mediaType) : base(mediaType) @@ -65,7 +65,7 @@ public RequestHeaderMapping(string headerName, string headerValue, StringCompari public StringComparison HeaderValueComparison { get; private set; } /// - /// Gets a value indicating whether is + /// Gets a value indicating whether is /// a matched as a substring of the actual header value. /// this instance is value substring. /// diff --git a/src/System.Net.Http.Formatting/Formatting/StringWithQualityHeaderValueComparer.cs b/src/System.Net.Http.Formatting/Formatting/StringWithQualityHeaderValueComparer.cs index c10caf277..6ded7c717 100644 --- a/src/System.Net.Http.Formatting/Formatting/StringWithQualityHeaderValueComparer.cs +++ b/src/System.Net.Http.Formatting/Formatting/StringWithQualityHeaderValueComparer.cs @@ -9,9 +9,9 @@ namespace System.Net.Http.Formatting { /// /// Implementation of that can compare content negotiation header fields - /// based on their quality values (a.k.a q-values). This applies to values used in accept-charset, - /// accept-encoding, accept-language and related header fields with similar syntax rules. See - /// for a comparer for media type + /// based on their quality values (a.k.a q-values). This applies to values used in accept-charset, + /// accept-encoding, accept-language and related header fields with similar syntax rules. See + /// for a comparer for media type /// q-values. /// internal class StringWithQualityHeaderValueComparer : IComparer diff --git a/src/System.Net.Http.Formatting/Formatting/XmlMediaTypeFormatter.cs b/src/System.Net.Http.Formatting/Formatting/XmlMediaTypeFormatter.cs index bec831de8..2ffd75975 100644 --- a/src/System.Net.Http.Formatting/Formatting/XmlMediaTypeFormatter.cs +++ b/src/System.Net.Http.Formatting/Formatting/XmlMediaTypeFormatter.cs @@ -67,8 +67,8 @@ protected XmlMediaTypeFormatter(XmlMediaTypeFormatter formatter) /// /// /// - /// The default media type does not have any charset parameter as - /// the can be configured on a per + /// The default media type does not have any charset parameter as + /// the can be configured on a per /// instance basis. /// /// Because is mutable, the value @@ -89,7 +89,7 @@ public static MediaTypeHeaderValue DefaultMediaType public bool UseXmlSerializer { get; set; } /// - /// Gets or sets a value indicating whether to indent elements when writing data. + /// Gets or sets a value indicating whether to indent elements when writing data. /// public bool Indent { diff --git a/src/System.Net.Http.Formatting/FormattingUtilities.cs b/src/System.Net.Http.Formatting/FormattingUtilities.cs index 220ce1d89..a1ac95595 100644 --- a/src/System.Net.Http.Formatting/FormattingUtilities.cs +++ b/src/System.Net.Http.Formatting/FormattingUtilities.cs @@ -18,7 +18,7 @@ namespace System.Net.Http internal static class FormattingUtilities { // Supported date formats for input. - private static readonly string[] dateFormats = new string[] + private static readonly string[] dateFormats = new string[] { // "r", // RFC 1123, required output format but too strict for input "ddd, d MMM yyyy H:m:s 'GMT'", // RFC 1123 (r, except it allows both 1 and 01 for date and time) @@ -134,7 +134,7 @@ public static bool IsJTokenType(Type type) } /// - /// Creates an empty instance. The only way is to get it from a dummy + /// Creates an empty instance. The only way is to get it from a dummy /// instance. /// /// The created instance. diff --git a/src/System.Net.Http.Formatting/Handlers/ProgressStream.cs b/src/System.Net.Http.Formatting/Handlers/ProgressStream.cs index fe545f9a2..8c169c94e 100644 --- a/src/System.Net.Http.Formatting/Handlers/ProgressStream.cs +++ b/src/System.Net.Http.Formatting/Handlers/ProgressStream.cs @@ -10,7 +10,7 @@ namespace System.Net.Http.Handlers { /// - /// This implementation of registers how much data has been + /// This implementation of registers how much data has been /// read (received) versus written (sent) for a particular HTTP operation. The implementation /// is client side in that the total bytes to send is taken from the request and the total /// bytes to read is taken from the response. In a server side scenario, it would be the diff --git a/src/System.Net.Http.Formatting/HttpContentFormDataExtensions.cs b/src/System.Net.Http.Formatting/HttpContentFormDataExtensions.cs index 19f5b9bc3..4a830684d 100644 --- a/src/System.Net.Http.Formatting/HttpContentFormDataExtensions.cs +++ b/src/System.Net.Http.Formatting/HttpContentFormDataExtensions.cs @@ -15,7 +15,7 @@ namespace System.Net.Http { /// - /// Extension methods to allow HTML form URL-encoded data, also known as application/x-www-form-urlencoded, + /// Extension methods to allow HTML form URL-encoded data, also known as application/x-www-form-urlencoded, /// to be read from instances. /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/src/System.Net.Http.Formatting/HttpContentMessageExtensions.cs b/src/System.Net.Http.Formatting/HttpContentMessageExtensions.cs index a7dcb869d..99ebe4b92 100644 --- a/src/System.Net.Http.Formatting/HttpContentMessageExtensions.cs +++ b/src/System.Net.Http.Formatting/HttpContentMessageExtensions.cs @@ -126,7 +126,7 @@ public static Task ReadAsHttpRequestMessageAsync(this HttpCo /// Read the as an . /// /// The content to read. - /// The URI scheme to use for the request URI (the + /// The URI scheme to use for the request URI (the /// URI scheme is not actually part of the HTTP Request URI and so must be provided externally). /// Size of the buffer. /// A task object representing reading the content as an . @@ -140,7 +140,7 @@ public static Task ReadAsHttpRequestMessageAsync(this HttpCo /// Read the as an . /// /// The content to read. - /// The URI scheme to use for the request URI (the + /// The URI scheme to use for the request URI (the /// URI scheme is not actually part of the HTTP Request URI and so must be provided externally). /// Size of the buffer. /// The token to monitor for cancellation requests. @@ -157,7 +157,7 @@ public static Task ReadAsHttpRequestMessageAsync(this HttpCo /// Read the as an . /// /// The content to read. - /// The URI scheme to use for the request URI (the + /// The URI scheme to use for the request URI (the /// URI scheme is not actually part of the HTTP Request URI and so must be provided externally). /// Size of the buffer. /// The max length of the HTTP header. @@ -174,7 +174,7 @@ public static Task ReadAsHttpRequestMessageAsync(this HttpCo /// Read the as an . /// /// The content to read. - /// The URI scheme to use for the request URI (the + /// The URI scheme to use for the request URI (the /// URI scheme is not actually part of the HTTP Request URI and so must be provided externally). /// Size of the buffer. /// The max length of the HTTP header. diff --git a/src/System.Net.Http.Formatting/HttpContentMultipartExtensions.cs b/src/System.Net.Http.Formatting/HttpContentMultipartExtensions.cs index dce8ce8fa..e9671d5b2 100644 --- a/src/System.Net.Http.Formatting/HttpContentMultipartExtensions.cs +++ b/src/System.Net.Http.Formatting/HttpContentMultipartExtensions.cs @@ -41,9 +41,9 @@ public static bool IsMimeMultipartContent(this HttpContent content) } /// - /// Determines whether the specified content is MIME multipart content with the + /// Determines whether the specified content is MIME multipart content with the /// specified subtype. For example, the subtype mixed would match content - /// with a content type of multipart/mixed. + /// with a content type of multipart/mixed. /// /// The content. /// The MIME multipart subtype to match. @@ -91,7 +91,7 @@ public static Task ReadAsMultipartAsync(this Http /// /// Reads all body parts within a MIME multipart message using the provided instance - /// to determine where the contents of each body part is written. + /// to determine where the contents of each body part is written. /// /// The with which to process the data. /// An existing instance to use for the object's content. @@ -104,7 +104,7 @@ public static Task ReadAsMultipartAsync(this HttpContent content, T stream /// /// Reads all body parts within a MIME multipart message using the provided instance - /// to determine where the contents of each body part is written. + /// to determine where the contents of each body part is written. /// /// The with which to process the data. /// An existing instance to use for the object's content. diff --git a/src/System.Net.Http.Formatting/HttpMessageContent.cs b/src/System.Net.Http.Formatting/HttpMessageContent.cs index 1d90b16d8..d34ca72b9 100644 --- a/src/System.Net.Http.Formatting/HttpMessageContent.cs +++ b/src/System.Net.Http.Formatting/HttpMessageContent.cs @@ -357,7 +357,7 @@ private byte[] SerializeHeader() private void ValidateStreamForReading(Stream stream) { // If the content needs to be written to a target stream a 2nd time, then the stream must support - // seeking (e.g. a FileStream), otherwise the stream can't be copied a second time to a target + // seeking (e.g. a FileStream), otherwise the stream can't be copied a second time to a target // stream (e.g. a NetworkStream). if (_contentConsumed) { diff --git a/src/System.Net.Http.Formatting/Internal/HttpValueCollection.cs b/src/System.Net.Http.Formatting/Internal/HttpValueCollection.cs index 1af77650e..3197a9733 100644 --- a/src/System.Net.Http.Formatting/Internal/HttpValueCollection.cs +++ b/src/System.Net.Http.Formatting/Internal/HttpValueCollection.cs @@ -40,7 +40,7 @@ internal class HttpValueCollection : NameValueCollection internal readonly List> List = new List>(); /// - /// Creates a new instance + /// Creates a new instance /// public HttpValueCollection() { diff --git a/src/System.Net.Http.Formatting/MimeBodyPart.cs b/src/System.Net.Http.Formatting/MimeBodyPart.cs index aa14f5dc6..fcd4a7f94 100644 --- a/src/System.Net.Http.Formatting/MimeBodyPart.cs +++ b/src/System.Net.Http.Formatting/MimeBodyPart.cs @@ -39,8 +39,8 @@ public MimeBodyPart(MultipartStreamProvider streamProvider, int maxBodyPartHeade Segments = new List>(2); _headers = FormattingUtilities.CreateEmptyContentHeaders(); HeaderParser = new InternetMessageFormatHeaderParser( - _headers, - maxBodyPartHeaderSize, + _headers, + maxBodyPartHeaderSize, ignoreHeaderValidation: true); } diff --git a/src/System.Net.Http.Formatting/MultipartRelatedStreamProvider.cs b/src/System.Net.Http.Formatting/MultipartRelatedStreamProvider.cs index 464f891e7..68b5a6034 100644 --- a/src/System.Net.Http.Formatting/MultipartRelatedStreamProvider.cs +++ b/src/System.Net.Http.Formatting/MultipartRelatedStreamProvider.cs @@ -24,7 +24,7 @@ public class MultipartRelatedStreamProvider : MultipartStreamProvider private HttpContent _parent; /// - /// Gets the instance that has been marked as the root content in the + /// Gets the instance that has been marked as the root content in the /// MIME multipart related message using the start parameter. If no start parameter is /// present then pick the first of the children. /// @@ -71,7 +71,7 @@ private static HttpContent FindRootContent(HttpContent parent, IEnumerable /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -23,15 +23,15 @@ namespace System.Net.Http.Properties { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { - + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// @@ -50,7 +50,7 @@ internal Resources() { return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. @@ -64,7 +64,7 @@ internal Resources() { resourceCulture = value; } } - + /// /// Looks up a localized string similar to Async Callback threw an exception.. /// @@ -73,7 +73,7 @@ internal static string AsyncResult_CallbackThrewException { return ResourceManager.GetString("AsyncResult_CallbackThrewException", resourceCulture); } } - + /// /// Looks up a localized string similar to The IAsyncResult implementation '{0}' tried to complete a single operation multiple times. This could be caused by an incorrect application IAsyncResult implementation or other extensibility code, such as an IAsyncResult that returns incorrect CompletedSynchronously values or invokes the AsyncCallback multiple times.. /// @@ -82,7 +82,7 @@ internal static string AsyncResult_MultipleCompletes { return ResourceManager.GetString("AsyncResult_MultipleCompletes", resourceCulture); } } - + /// /// Looks up a localized string similar to End cannot be called twice on an AsyncResult.. /// @@ -91,7 +91,7 @@ internal static string AsyncResult_MultipleEnds { return ResourceManager.GetString("AsyncResult_MultipleEnds", resourceCulture); } } - + /// /// Looks up a localized string similar to An incorrect IAsyncResult was provided to an 'End' method. The IAsyncResult object passed to 'End' must be the one returned from the matching 'Begin' or passed to the callback provided to 'Begin'.. /// @@ -100,7 +100,7 @@ internal static string AsyncResult_ResultMismatch { return ResourceManager.GetString("AsyncResult_ResultMismatch", resourceCulture); } } - + /// /// Looks up a localized string similar to Found zero byte ranges. There must be at least one byte range provided.. /// @@ -109,7 +109,7 @@ internal static string ByteRangeStreamContentNoRanges { return ResourceManager.GetString("ByteRangeStreamContentNoRanges", resourceCulture); } } - + /// /// Looks up a localized string similar to The range unit '{0}' is not valid. The range must have a unit of '{1}'.. /// @@ -118,7 +118,7 @@ internal static string ByteRangeStreamContentNotBytesRange { return ResourceManager.GetString("ByteRangeStreamContentNotBytesRange", resourceCulture); } } - + /// /// Looks up a localized string similar to The stream over which '{0}' provides a range view must have a length greater than or equal to 1.. /// @@ -127,7 +127,7 @@ internal static string ByteRangeStreamEmpty { return ResourceManager.GetString("ByteRangeStreamEmpty", resourceCulture); } } - + /// /// Looks up a localized string similar to The 'From' value of the range must be less than or equal to {0}.. /// @@ -136,7 +136,7 @@ internal static string ByteRangeStreamInvalidFrom { return ResourceManager.GetString("ByteRangeStreamInvalidFrom", resourceCulture); } } - + /// /// Looks up a localized string similar to An attempt was made to move the position before the beginning of the stream.. /// @@ -145,7 +145,7 @@ internal static string ByteRangeStreamInvalidOffset { return ResourceManager.GetString("ByteRangeStreamInvalidOffset", resourceCulture); } } - + /// /// Looks up a localized string similar to None of the requested ranges ({0}) overlap with the current extent of the selected resource.. /// @@ -154,7 +154,7 @@ internal static string ByteRangeStreamNoneOverlap { return ResourceManager.GetString("ByteRangeStreamNoneOverlap", resourceCulture); } } - + /// /// Looks up a localized string similar to The requested range ({0}) does not overlap with the current extent of the selected resource.. /// @@ -163,7 +163,7 @@ internal static string ByteRangeStreamNoOverlap { return ResourceManager.GetString("ByteRangeStreamNoOverlap", resourceCulture); } } - + /// /// Looks up a localized string similar to The stream over which '{0}' provides a range view must be seekable.. /// @@ -172,7 +172,7 @@ internal static string ByteRangeStreamNotSeekable { return ResourceManager.GetString("ByteRangeStreamNotSeekable", resourceCulture); } } - + /// /// Looks up a localized string similar to This is a read-only stream.. /// @@ -181,7 +181,7 @@ internal static string ByteRangeStreamReadOnly { return ResourceManager.GetString("ByteRangeStreamReadOnly", resourceCulture); } } - + /// /// Looks up a localized string similar to A null '{0}' is not valid.. /// @@ -190,7 +190,7 @@ internal static string CannotHaveNullInList { return ResourceManager.GetString("CannotHaveNullInList", resourceCulture); } } - + /// /// Looks up a localized string similar to The '{0}' of '{1}' cannot be used as a supported media type because it is a media range.. /// @@ -199,7 +199,7 @@ internal static string CannotUseMediaRangeForSupportedMediaType { return ResourceManager.GetString("CannotUseMediaRangeForSupportedMediaType", resourceCulture); } } - + /// /// Looks up a localized string similar to The '{0}' type cannot accept a null value for the value type '{1}'.. /// @@ -208,7 +208,7 @@ internal static string CannotUseNullValueType { return ResourceManager.GetString("CannotUseNullValueType", resourceCulture); } } - + /// /// Looks up a localized string similar to The specified value is not a valid cookie name.. /// @@ -217,7 +217,7 @@ internal static string CookieInvalidName { return ResourceManager.GetString("CookieInvalidName", resourceCulture); } } - + /// /// Looks up a localized string similar to Cookie cannot be null.. /// @@ -226,7 +226,7 @@ internal static string CookieNull { return ResourceManager.GetString("CookieNull", resourceCulture); } } - + /// /// Looks up a localized string similar to The '{0}' list is invalid because it contains one or more null items.. /// @@ -235,7 +235,7 @@ internal static string DelegatingHandlerArrayContainsNullItem { return ResourceManager.GetString("DelegatingHandlerArrayContainsNullItem", resourceCulture); } } - + /// /// Looks up a localized string similar to The '{0}' list is invalid because the property '{1}' of '{2}' is not null.. /// @@ -244,7 +244,7 @@ internal static string DelegatingHandlerArrayHasNonNullInnerHandler { return ResourceManager.GetString("DelegatingHandlerArrayHasNonNullInnerHandler", resourceCulture); } } - + /// /// Looks up a localized string similar to Error reading HTML form URL-encoded data stream.. /// @@ -253,7 +253,7 @@ internal static string ErrorReadingFormUrlEncodedStream { return ResourceManager.GetString("ErrorReadingFormUrlEncodedStream", resourceCulture); } } - + /// /// Looks up a localized string similar to Mismatched types at node '{0}'.. /// @@ -262,7 +262,7 @@ internal static string FormUrlEncodedMismatchingTypes { return ResourceManager.GetString("FormUrlEncodedMismatchingTypes", resourceCulture); } } - + /// /// Looks up a localized string similar to Error parsing HTML form URL-encoded data, byte {0}.. /// @@ -271,7 +271,7 @@ internal static string FormUrlEncodedParseError { return ResourceManager.GetString("FormUrlEncodedParseError", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid HTTP status code: '{0}'. The status code must be between {1} and {2}.. /// @@ -280,7 +280,7 @@ internal static string HttpInvalidStatusCode { return ResourceManager.GetString("HttpInvalidStatusCode", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid HTTP version: '{0}'. The version must start with the characters '{1}'.. /// @@ -289,7 +289,7 @@ internal static string HttpInvalidVersion { return ResourceManager.GetString("HttpInvalidVersion", resourceCulture); } } - + /// /// Looks up a localized string similar to The '{0}' of the '{1}' has already been read.. /// @@ -298,7 +298,7 @@ internal static string HttpMessageContentAlreadyRead { return ResourceManager.GetString("HttpMessageContentAlreadyRead", resourceCulture); } } - + /// /// Looks up a localized string similar to The '{0}' must be seekable in order to create an '{1}' instance containing an entity body. . /// @@ -307,7 +307,7 @@ internal static string HttpMessageContentStreamMustBeSeekable { return ResourceManager.GetString("HttpMessageContentStreamMustBeSeekable", resourceCulture); } } - + /// /// Looks up a localized string similar to Error reading HTTP message.. /// @@ -316,7 +316,7 @@ internal static string HttpMessageErrorReading { return ResourceManager.GetString("HttpMessageErrorReading", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid '{0}' instance provided. It does not have a content type header with a value of '{1}'.. /// @@ -325,7 +325,7 @@ internal static string HttpMessageInvalidMediaType { return ResourceManager.GetString("HttpMessageInvalidMediaType", resourceCulture); } } - + /// /// Looks up a localized string similar to HTTP Request URI cannot be an empty string.. /// @@ -334,7 +334,7 @@ internal static string HttpMessageParserEmptyUri { return ResourceManager.GetString("HttpMessageParserEmptyUri", resourceCulture); } } - + /// /// Looks up a localized string similar to Error parsing HTTP message header byte {0} of message {1}.. /// @@ -343,7 +343,7 @@ internal static string HttpMessageParserError { return ResourceManager.GetString("HttpMessageParserError", resourceCulture); } } - + /// /// Looks up a localized string similar to An invalid number of '{0}' header fields were present in the HTTP Request. It must contain exactly one '{0}' header field but found {1}.. /// @@ -352,7 +352,7 @@ internal static string HttpMessageParserInvalidHostCount { return ResourceManager.GetString("HttpMessageParserInvalidHostCount", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid URI scheme: '{0}'. The URI scheme must be a valid '{1}' scheme.. /// @@ -361,7 +361,7 @@ internal static string HttpMessageParserInvalidUriScheme { return ResourceManager.GetString("HttpMessageParserInvalidUriScheme", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid array at node '{0}'.. /// @@ -370,7 +370,7 @@ internal static string InvalidArrayInsert { return ResourceManager.GetString("InvalidArrayInsert", resourceCulture); } } - + /// /// Looks up a localized string similar to Traditional style array without '[]' is not supported with nested object at location {0}.. /// @@ -379,7 +379,7 @@ internal static string JQuery13CompatModeNotSupportNestedJson { return ResourceManager.GetString("JQuery13CompatModeNotSupportNestedJson", resourceCulture); } } - + /// /// Looks up a localized string similar to The '{0}' method returned null. It must return a JSON serializer instance.. /// @@ -388,7 +388,7 @@ internal static string JsonSerializerFactoryReturnedNull { return ResourceManager.GetString("JsonSerializerFactoryReturnedNull", resourceCulture); } } - + /// /// Looks up a localized string similar to The '{0}' method threw an exception when attempting to create a JSON serializer.. /// @@ -397,7 +397,7 @@ internal static string JsonSerializerFactoryThrew { return ResourceManager.GetString("JsonSerializerFactoryThrew", resourceCulture); } } - + /// /// Looks up a localized string similar to The maximum read depth ({0}) has been exceeded because the form url-encoded data being read has more levels of nesting than is allowed.. /// @@ -406,7 +406,7 @@ internal static string MaxDepthExceeded { return ResourceManager.GetString("MaxDepthExceeded", resourceCulture); } } - + /// /// Looks up a localized string similar to The number of keys in a NameValueCollection has exceeded the limit of '{0}'. You can adjust it by modifying the MaxHttpCollectionKeys property on the '{1}' class.. /// @@ -415,7 +415,7 @@ internal static string MaxHttpCollectionKeyLimitReached { return ResourceManager.GetString("MaxHttpCollectionKeyLimitReached", resourceCulture); } } - + /// /// Looks up a localized string similar to Error parsing BSON data; unable to read content as a {0}.. /// @@ -424,7 +424,7 @@ internal static string MediaTypeFormatter_BsonParseError_MissingData { return ResourceManager.GetString("MediaTypeFormatter_BsonParseError_MissingData", resourceCulture); } } - + /// /// Looks up a localized string similar to Error parsing BSON data; unexpected dictionary content: {0} entries, first key '{1}'.. /// @@ -433,7 +433,7 @@ internal static string MediaTypeFormatter_BsonParseError_UnexpectedData { return ResourceManager.GetString("MediaTypeFormatter_BsonParseError_UnexpectedData", resourceCulture); } } - + /// /// Looks up a localized string similar to The '{0}' method returned null. It must return a JSON reader instance.. /// @@ -442,7 +442,7 @@ internal static string MediaTypeFormatter_JsonReaderFactoryReturnedNull { return ResourceManager.GetString("MediaTypeFormatter_JsonReaderFactoryReturnedNull", resourceCulture); } } - + /// /// Looks up a localized string similar to The '{0}' method returned null. It must return a JSON writer instance.. /// @@ -451,7 +451,7 @@ internal static string MediaTypeFormatter_JsonWriterFactoryReturnedNull { return ResourceManager.GetString("MediaTypeFormatter_JsonWriterFactoryReturnedNull", resourceCulture); } } - + /// /// Looks up a localized string similar to The media type formatter of type '{0}' does not support reading because it does not implement the ReadFromStreamAsync method.. /// @@ -460,7 +460,7 @@ internal static string MediaTypeFormatterCannotRead { return ResourceManager.GetString("MediaTypeFormatterCannotRead", resourceCulture); } } - + /// /// Looks up a localized string similar to The media type formatter of type '{0}' does not support reading because it does not implement the ReadFromStream method.. /// @@ -469,7 +469,7 @@ internal static string MediaTypeFormatterCannotReadSync { return ResourceManager.GetString("MediaTypeFormatterCannotReadSync", resourceCulture); } } - + /// /// Looks up a localized string similar to The media type formatter of type '{0}' does not support writing because it does not implement the WriteToStreamAsync method.. /// @@ -478,7 +478,7 @@ internal static string MediaTypeFormatterCannotWrite { return ResourceManager.GetString("MediaTypeFormatterCannotWrite", resourceCulture); } } - + /// /// Looks up a localized string similar to The media type formatter of type '{0}' does not support writing because it does not implement the WriteToStream method.. /// @@ -487,7 +487,7 @@ internal static string MediaTypeFormatterCannotWriteSync { return ResourceManager.GetString("MediaTypeFormatterCannotWriteSync", resourceCulture); } } - + /// /// Looks up a localized string similar to No encoding found for media type formatter '{0}'. There must be at least one supported encoding registered in order for the media type formatter to read or write content.. /// @@ -496,7 +496,7 @@ internal static string MediaTypeFormatterNoEncoding { return ResourceManager.GetString("MediaTypeFormatterNoEncoding", resourceCulture); } } - + /// /// Looks up a localized string similar to MIME multipart boundary cannot end with an empty space.. /// @@ -505,7 +505,7 @@ internal static string MimeMultipartParserBadBoundary { return ResourceManager.GetString("MimeMultipartParserBadBoundary", resourceCulture); } } - + /// /// Looks up a localized string similar to Did not find required '{0}' header field in MIME multipart body part.. /// @@ -514,7 +514,7 @@ internal static string MultipartFormDataStreamProviderNoContentDisposition { return ResourceManager.GetString("MultipartFormDataStreamProviderNoContentDisposition", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not determine a valid local file name for the multipart body part.. /// @@ -523,7 +523,7 @@ internal static string MultipartStreamProviderInvalidLocalFileName { return ResourceManager.GetString("MultipartStreamProviderInvalidLocalFileName", resourceCulture); } } - + /// /// Looks up a localized string similar to Nested bracket is not valid for '{0}' data at position {1}.. /// @@ -532,7 +532,7 @@ internal static string NestedBracketNotValid { return ResourceManager.GetString("NestedBracketNotValid", resourceCulture); } } - + /// /// Looks up a localized string similar to A non-null request URI must be provided to determine if a '{0}' matches a given request or response message.. /// @@ -541,7 +541,7 @@ internal static string NonNullUriRequiredForMediaTypeMapping { return ResourceManager.GetString("NonNullUriRequiredForMediaTypeMapping", resourceCulture); } } - + /// /// Looks up a localized string similar to No MediaTypeFormatter is available to read an object of type '{0}' from content with media type '{1}'.. /// @@ -550,7 +550,7 @@ internal static string NoReadSerializerAvailable { return ResourceManager.GetString("NoReadSerializerAvailable", resourceCulture); } } - + /// /// Looks up a localized string similar to An object of type '{0}' cannot be used with a type parameter of '{1}'.. /// @@ -559,7 +559,7 @@ internal static string ObjectAndTypeDisagree { return ResourceManager.GetString("ObjectAndTypeDisagree", resourceCulture); } } - + /// /// Looks up a localized string similar to The configured formatter '{0}' cannot write an object of type '{1}'.. /// @@ -568,7 +568,7 @@ internal static string ObjectContent_FormatterCannotWriteType { return ResourceManager.GetString("ObjectContent_FormatterCannotWriteType", resourceCulture); } } - + /// /// Looks up a localized string similar to Query string name cannot be null.. /// @@ -577,7 +577,7 @@ internal static string QueryStringNameShouldNotNull { return ResourceManager.GetString("QueryStringNameShouldNotNull", resourceCulture); } } - + /// /// Looks up a localized string similar to Unexpected end of HTTP message stream. HTTP message is not complete.. /// @@ -586,7 +586,7 @@ internal static string ReadAsHttpMessageUnexpectedTermination { return ResourceManager.GetString("ReadAsHttpMessageUnexpectedTermination", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid '{0}' instance provided. It does not have a '{1}' content-type header with a '{2}' parameter.. /// @@ -595,7 +595,7 @@ internal static string ReadAsMimeMultipartArgumentNoBoundary { return ResourceManager.GetString("ReadAsMimeMultipartArgumentNoBoundary", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid '{0}' instance provided. It does not have a content-type header value. '{0}' instances must have a content-type header starting with '{1}'.. /// @@ -604,7 +604,7 @@ internal static string ReadAsMimeMultipartArgumentNoContentType { return ResourceManager.GetString("ReadAsMimeMultipartArgumentNoContentType", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid '{0}' instance provided. It does not have a content type header starting with '{1}'.. /// @@ -613,7 +613,7 @@ internal static string ReadAsMimeMultipartArgumentNoMultipart { return ResourceManager.GetString("ReadAsMimeMultipartArgumentNoMultipart", resourceCulture); } } - + /// /// Looks up a localized string similar to Error reading MIME multipart body part.. /// @@ -622,7 +622,7 @@ internal static string ReadAsMimeMultipartErrorReading { return ResourceManager.GetString("ReadAsMimeMultipartErrorReading", resourceCulture); } } - + /// /// Looks up a localized string similar to Error writing MIME multipart body part to output stream.. /// @@ -631,7 +631,7 @@ internal static string ReadAsMimeMultipartErrorWriting { return ResourceManager.GetString("ReadAsMimeMultipartErrorWriting", resourceCulture); } } - + /// /// Looks up a localized string similar to Error parsing MIME multipart body part header byte {0} of data segment {1}.. /// @@ -640,7 +640,7 @@ internal static string ReadAsMimeMultipartHeaderParseError { return ResourceManager.GetString("ReadAsMimeMultipartHeaderParseError", resourceCulture); } } - + /// /// Looks up a localized string similar to Error parsing MIME multipart message byte {0} of data segment {1}.. /// @@ -649,7 +649,7 @@ internal static string ReadAsMimeMultipartParseError { return ResourceManager.GetString("ReadAsMimeMultipartParseError", resourceCulture); } } - + /// /// Looks up a localized string similar to The stream provider of type '{0}' threw an exception.. /// @@ -658,7 +658,7 @@ internal static string ReadAsMimeMultipartStreamProviderException { return ResourceManager.GetString("ReadAsMimeMultipartStreamProviderException", resourceCulture); } } - + /// /// Looks up a localized string similar to The stream provider of type '{0}' returned null. It must return a writable '{1}' instance.. /// @@ -667,7 +667,7 @@ internal static string ReadAsMimeMultipartStreamProviderNull { return ResourceManager.GetString("ReadAsMimeMultipartStreamProviderNull", resourceCulture); } } - + /// /// Looks up a localized string similar to The stream provider of type '{0}' returned a read-only stream. It must return a writable '{1}' instance.. /// @@ -676,7 +676,7 @@ internal static string ReadAsMimeMultipartStreamProviderReadOnly { return ResourceManager.GetString("ReadAsMimeMultipartStreamProviderReadOnly", resourceCulture); } } - + /// /// Looks up a localized string similar to Unexpected end of MIME multipart stream. MIME multipart message is not complete.. /// @@ -685,7 +685,7 @@ internal static string ReadAsMimeMultipartUnexpectedTermination { return ResourceManager.GetString("ReadAsMimeMultipartUnexpectedTermination", resourceCulture); } } - + /// /// Looks up a localized string similar to The '{0}' method in '{1}' returned null. It must return a RemoteStreamResult instance containing a writable stream and a valid URL.. /// @@ -694,7 +694,7 @@ internal static string RemoteStreamInfoCannotBeNull { return ResourceManager.GetString("RemoteStreamInfoCannotBeNull", resourceCulture); } } - + /// /// Looks up a localized string similar to The '{0}' serializer cannot serialize the type '{1}'.. /// @@ -703,7 +703,7 @@ internal static string SerializerCannotSerializeType { return ResourceManager.GetString("SerializerCannotSerializeType", resourceCulture); } } - + /// /// Looks up a localized string similar to There is an unmatched opened bracket for the '{0}' at position {1}.. /// @@ -712,7 +712,7 @@ internal static string UnMatchedBracketNotValid { return ResourceManager.GetString("UnMatchedBracketNotValid", resourceCulture); } } - + /// /// Looks up a localized string similar to Indentation is not supported by '{0}'.. /// @@ -721,7 +721,7 @@ internal static string UnsupportedIndent { return ResourceManager.GetString("UnsupportedIndent", resourceCulture); } } - + /// /// Looks up a localized string similar to The object of type '{0}' returned by {1} must be an instance of either XmlObjectSerializer or XmlSerializer.. /// @@ -730,7 +730,7 @@ internal static string XmlMediaTypeFormatter_InvalidSerializerType { return ResourceManager.GetString("XmlMediaTypeFormatter_InvalidSerializerType", resourceCulture); } } - + /// /// Looks up a localized string similar to The object returned by {0} must not be a null value.. /// diff --git a/test/System.Web.WebPages.Test/ApplicationParts/ApplicationPartTest.cs b/test/System.Web.WebPages.Test/ApplicationParts/ApplicationPartTest.cs index 742da8aee..8ff5ea3a9 100644 --- a/test/System.Web.WebPages.Test/ApplicationParts/ApplicationPartTest.cs +++ b/test/System.Web.WebPages.Test/ApplicationParts/ApplicationPartTest.cs @@ -70,7 +70,7 @@ public void GetResourceNameFromVirtualPathForTopLevelPath() var moduleName = "my-module"; var path = "foo.baz"; - // Act + // Act var name = ApplicationPart.GetResourceNameFromVirtualPath(moduleName, path); // Assert @@ -84,7 +84,7 @@ public void GetResourceNameFromVirtualPathForItemInSubDir() var moduleName = "my-module"; var path = "/bar/foo"; - // Act + // Act var name = ApplicationPart.GetResourceNameFromVirtualPath(moduleName, path); // Assert @@ -98,7 +98,7 @@ public void GetResourceNameFromVirtualPathForItemWithSpaces() var moduleName = "my-module"; var path = "/program files/data files/my file .foo"; - // Act + // Act var name = ApplicationPart.GetResourceNameFromVirtualPath(moduleName, path); // Assert diff --git a/tools/WebStack.tasks.targets b/tools/WebStack.tasks.targets index fbebe6774..cf88c574c 100644 --- a/tools/WebStack.tasks.targets +++ b/tools/WebStack.tasks.targets @@ -30,6 +30,7 @@ if (!Version.TryParse(MinimumVersion, out minimumRequiredVersion)) { Log.LogError("MinimumVersion '{0}' is not a valid Version.", MinimumVersion); + return false; } try @@ -74,7 +75,7 @@ if (!File.Exists(OutputFileName)) { - Log.LogMessage("Downloading latest version of NuGet.exe..."); + Log.LogMessage(MessageImportance.High, "Downloading latest version of NuGet.exe..."); WebClient webClient = new WebClient(); webClient.DownloadFile("https://dist.nuget.org/win-x86-commandline/latest/nuget.exe", OutputFileName); } @@ -91,58 +92,6 @@ - - - - - - - - - - - - - - - - - - - - @@ -154,13 +103,18 @@ + + + + [0-9A-Fa-f]+);", + RegexOptions.Multiline | RegexOptions.Compiled); int testsPassed = 0; int testsFailed = 0; int testsSkipped = 0; @@ -169,8 +123,20 @@ foreach (string testResultFile in testResultFiles) { + // Replace potentially illegal escaped characters (if they get through validations done during Save). + string fullPath = Path.GetFullPath(testResultFile); + string originalText = File.ReadAllText(fullPath); + bool matched = regex.IsMatch(originalText); + + if (matched) + { + File.SetAttributes(fullPath, File.GetAttributes(fullPath) & ~FileAttributes.ReadOnly); + File.WriteAllText(fullPath, regex.Replace(originalText, "\0x${char}"), Encoding.UTF8); + } + + // Collect test failure information from results file. XElement xml; - using (FileStream fileStream = File.OpenRead(testResultFile)) + using (FileStream fileStream = File.OpenRead(fullPath)) { xml = XElement.Load(fileStream); } @@ -213,23 +179,32 @@ } } + // Log all test failures. if (testFailures.Count > 0) { - Console.WriteLine(); - Console.WriteLine(" Test Failures:"); - ConsoleColor originalColor = Console.ForegroundColor; - Console.ForegroundColor = ConsoleColor.Red; + Log.LogMessage(MessageImportance.High, string.Empty); + Log.LogError("Tests failed..."); foreach (string testFailure in testFailures) { - Console.WriteLine(" " + testFailure); + // Provide the list of failed tests but don't repeat it in the build summary. List + // is usually less helpful than errors from tests themselves (which are repeated) + // because those errors include the exact failure locations. On the other hand, + // this is more compact. + Log.LogMessage(MessageImportance.High, testFailure); } - Console.ForegroundColor = originalColor; } - Console.WriteLine(); - Console.WriteLine(" Tests passed: {0}, Tests failed: {1}, Tests skipped: {2}", testsPassed, testsFailed, testsSkipped); - Console.WriteLine(" Time spent running tests: {0} seconds", timeSpent); - return true; + // Log summary of all results. + Log.LogMessage(MessageImportance.High, string.Empty); + Log.LogMessage(MessageImportance.High, + "Tests passed: {0}, Tests failed: {1}, Tests skipped: {2}", + testsPassed, + testsFailed, + testsSkipped); + Log.LogMessage(MessageImportance.High, + "Time spent running tests: {0} seconds", timeSpent); + + return !Log.HasLoggedErrors; } catch (Exception ex) { @@ -240,4 +215,4 @@ - \ No newline at end of file + diff --git a/tools/WebStack.xunit.targets b/tools/WebStack.xunit.targets index 3392c1dde..d11eaee74 100644 --- a/tools/WebStack.xunit.targets +++ b/tools/WebStack.xunit.targets @@ -1,18 +1,17 @@ - + + - - + + + + - - - - - - - \ No newline at end of file + + <_ExitCodes Include="$(TestAssembly)" Code="$(_ExitCode)" /> + + + From 1585561a531fb7621bdb3ade3d7e1c79edc8aa81 Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Thu, 23 Jun 2022 17:24:08 -0700 Subject: [PATCH 2/4] Bump Newtonsoft.Json to 13.0.1 - also bump Newtonsoft.Json.Bson to 1.0.2 in System.Net.Http.Formatting.NetStandard - incorporates changes from 23 Dependabot PRs; they are now obsolete - Dependabot also left `@(Reference)` items alone in project files :frowning: - fixed what Dependabot didn't do i.e. corrected paths and assembly identities in those items
Release notes

Sourced from Newtonsoft.Json's releases.

13.0.1

  • New feature - Add JsonSelectSettings with configuration for a regex timeout
  • Change - Remove portable assemblies from NuGet package
  • Change - JsonReader and JsonSerializer MaxDepth defaults to 64
  • Fix - Fixed throwing missing member error on ignored fields
  • Fix - Fixed various nullable annotations
  • Fix - Fixed annotations not being copied when tokens are cloned
  • Fix - Fixed naming strategy not being used when deserializing dictionary enum keys
  • Fix - Fixed serializing nullable struct dictionaries
  • Fix - Fixed JsonWriter.WriteToken to allow null with string token
  • Fix - Fixed missing error when deserializing JToken with a contract type mismatch
  • Fix - Fixed JTokenWriter when writing comment to an object

12.0.3

  • New feature - Added support for nullable reference types
  • New feature - Added KebabCaseNamingStrategy
  • Change - Package now uses embedded package icon
  • Fix - Fixed bug when merging JToken with itself
  • Fix - Fixed performance of calling ICustomTypeDescriptor.GetProperties
  • Fix - Fixed serializing Enumerable.Empty and empty arrays on .NET Core 3.0
  • Fix - Fixed deserializing some collection types with constructor
  • Fix - Fixed deserializing IImmutableSet to ImmutableHashSet instead of ImmutableSortedSet
  • Fix - Fixed deserializing IImmutableDictionary to ImmutableDictionary instead of ImmutableSortedDictionary
  • Fix - Fixed deserializing into constructors with more than 256 parameters
  • Fix - Fixed hang when deserializing JTokenReader with preceding comment
  • Fix - Fixed JSONPath scanning with nested indexer
  • Fix - Fixed deserializing incomplete JSON object to JObject
  • Fix - Fixed using StringEnumConverter with naming strategy and specified values

12.0.2

  • New feature - Added MissingMemberHandling to JsonObjectAttribute and JsonObjectContract
  • New feature - Added constructor to JTokenReader to specify initial path
  • New feature - Added JsonProperty.IsRequiredSpecified
  • New feature - Added JsonContract.InternalConverter
  • Change - Moved embedded debug symbols in NuGet package to a symbol package on NuGet.org
  • Fix - Fixed deserializing nullable struct collections
  • Fix - Fixed memory link when serializing enums to named values
  • Fix - Fixed error when setting JsonLoadSettings.DuplicatePropertyNameHandling to Replace

12.0.1

  • New feature - Added NuGet package signing
  • New feature - Added Authenticode assembly signing
  • New feature - Added SourceLink support
  • New feature - Added constructors to StringEnumConverter for setting AllowIntegerValue
  • New feature - Added JsonNameTable and JsonTextReader.PropertyNameTable
  • New feature - Added line information to JsonSerializationException
  • New feature - Added JObject.Property overload with a StringComparison
  • New feature - Added JsonMergeSettings.PropertyNameComparison
  • New feature - Added support for multiple Date constructors with JavaScriptDateTimeConverter
  • New feature - Added support for strict equals and strict not equals in JSON Path queries

... (truncated)

Commits
--- .../Microsoft.AspNet.Facebook.csproj | 4 ++-- src/Microsoft.AspNet.Facebook/packages.config | 2 +- .../System.Net.Http.Formatting.NetCore.csproj | 4 ++-- src/System.Net.Http.Formatting.NetCore/packages.config | 2 +- .../System.Net.Http.Formatting.NetStandard.csproj | 4 ++-- .../System.Net.Http.Formatting.csproj | 4 ++-- src/System.Net.Http.Formatting/packages.config | 2 +- src/System.Web.Http.SignalR/System.Web.Http.SignalR.csproj | 4 ++-- src/System.Web.Http.SignalR/packages.config | 2 +- src/System.Web.Http.Tracing/System.Web.Http.Tracing.csproj | 4 ++-- src/System.Web.Http.Tracing/packages.config | 2 +- src/System.Web.Http/System.Web.Http.csproj | 4 ++-- src/System.Web.Http/packages.config | 2 +- src/WebApiHelpPage/VB/WebApiHelpPageVB.vbproj | 4 ++-- src/WebApiHelpPage/VB/packages.config | 2 +- src/WebApiHelpPage/WebApiHelpPage.csproj | 4 ++-- src/WebApiHelpPage/packages.config | 2 +- .../Microsoft.AspNet.Facebook.Test.csproj | 6 +++--- test/Microsoft.AspNet.Facebook.Test/packages.config | 2 +- test/Microsoft.Web.Mvc.Test/Microsoft.Web.Mvc.Test.csproj | 4 ++-- test/Microsoft.Web.Mvc.Test/packages.config | 2 +- .../System.Net.Http.Formatting.NetCore.Test.csproj | 4 ++-- .../System.Net.Http.Formatting.NetCore.Test/packages.config | 2 +- .../System.Net.Http.Formatting.Test.csproj | 4 ++-- test/System.Net.Http.Formatting.Test/packages.config | 2 +- .../System.Web.Http.Cors.Test.csproj | 4 ++-- test/System.Web.Http.Cors.Test/packages.config | 2 +- .../System.Web.Http.Integration.Test.csproj | 4 ++-- test/System.Web.Http.Integration.Test/packages.config | 2 +- .../System.Web.Http.Owin.Test.csproj | 4 ++-- test/System.Web.Http.Owin.Test/packages.config | 2 +- .../System.Web.Http.SelfHost.Test.csproj | 4 ++-- test/System.Web.Http.SelfHost.Test/packages.config | 2 +- .../System.Web.Http.SignalR.Test.csproj | 4 ++-- test/System.Web.Http.SignalR.Test/packages.config | 2 +- test/System.Web.Http.Test/System.Web.Http.Test.csproj | 4 ++-- test/System.Web.Http.Test/packages.config | 2 +- .../System.Web.Http.Tracing.Test.csproj | 6 +++--- test/System.Web.Http.Tracing.Test/packages.config | 2 +- .../System.Web.Http.WebHost.Test.csproj | 4 ++-- test/System.Web.Http.WebHost.Test/packages.config | 2 +- test/System.Web.Mvc.Test/System.Web.Mvc.Test.csproj | 4 ++-- test/System.Web.Mvc.Test/packages.config | 2 +- test/WebApiHelpPage.Test/WebApiHelpPage.Test.csproj | 6 +++--- test/WebApiHelpPage.Test/packages.config | 2 +- test/WebApiHelpPage.VB.Test/WebApiHelpPage.VB.Test.csproj | 6 +++--- 46 files changed, 74 insertions(+), 74 deletions(-) diff --git a/src/Microsoft.AspNet.Facebook/Microsoft.AspNet.Facebook.csproj b/src/Microsoft.AspNet.Facebook/Microsoft.AspNet.Facebook.csproj index 7e0f0f6ba..12642c354 100644 --- a/src/Microsoft.AspNet.Facebook/Microsoft.AspNet.Facebook.csproj +++ b/src/Microsoft.AspNet.Facebook/Microsoft.AspNet.Facebook.csproj @@ -26,8 +26,8 @@ False ..\..\packages\Facebook.6.4.2\lib\net45\Facebook.dll - - ..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll + + ..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll False False diff --git a/src/Microsoft.AspNet.Facebook/packages.config b/src/Microsoft.AspNet.Facebook/packages.config index 613e222f9..102ce84aa 100644 --- a/src/Microsoft.AspNet.Facebook/packages.config +++ b/src/Microsoft.AspNet.Facebook/packages.config @@ -2,5 +2,5 @@ - + \ No newline at end of file diff --git a/src/System.Net.Http.Formatting.NetCore/System.Net.Http.Formatting.NetCore.csproj b/src/System.Net.Http.Formatting.NetCore/System.Net.Http.Formatting.NetCore.csproj index 364d375d4..e579c5926 100644 --- a/src/System.Net.Http.Formatting.NetCore/System.Net.Http.Formatting.NetCore.csproj +++ b/src/System.Net.Http.Formatting.NetCore/System.Net.Http.Formatting.NetCore.csproj @@ -254,7 +254,7 @@ - ..\..\packages\Newtonsoft.Json.6.0.4\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll + ..\..\packages\Newtonsoft.Json.13.0.1\lib\netstandard1.0\Newtonsoft.Json.dll ..\..\packages\Microsoft.Net.Http.2.2.13\lib\portable-net40+sl4+win8+wp71\System.Net.Http.dll @@ -266,7 +266,7 @@ ..\..\packages\Microsoft.Net.Http.2.2.13\lib\portable-net40+sl4+win8+wp71\System.Net.Http.Primitives.dll -