Commit Graph
658 Commits
Author SHA1 Message Date
Stephen Toub 182e23d123 Re-enable StyleCop warning SA1400 (elements should specify access) (dotnet/corefx#40240)
One of the more common things we "nit" in PRs.  Now the compiler will flag it for us.

Commit migrated from https://github.com/dotnet/corefx/commit/61a6264018989e06d314b68d57bd91b4b72e4360
2019-08-12 14:29:19 +02:00
Stephen Toub 60d1224ddd Re-enable StyleCop warnings SA1028 and SA1518 (trailing whitespace and blank lines) (dotnet/corefx#40113)
Mechanical/automated change.  The only manual changes were a) removing the two rules from the CodeAnalysis.ruleset file, b) removing spaces from one line of a .targets file that is used to generate a .cs file, and c) reverting the changes in a few test files where the naive replacement happened in the middle of a verbatim string where the whitespace actually mattered.

Commit migrated from https://github.com/dotnet/corefx/commit/09a6e66b0c2b31bd0f6e7e3170537d14027aeed0
2019-08-07 21:07:58 -04:00
Stephen Toub 34e34383a3 Re-enable StyleCop warning SA1113 (comma on same line as previous parameter)
Commit migrated from https://github.com/dotnet/corefx/commit/e83c72910b62ea31fdb4952795a5322be7a98540
2019-08-07 19:15:26 -04:00
Stephen Toub cd386d1dbb Remove some unused locals (dotnet/corefx#39956)
* Remove some unused locals

Trying out various analyzers, including one to flag unused locals.  There are more than this, but this is a first batch.  Some of these are just clean-up.  Others are saving unnecessary cost.  At least one appears to be a real functional bug.

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/545d9959aebded62a26d20c7c1bf86785a92e52a
2019-08-05 11:05:14 -04:00
Stephen Toub cd3ca6f991 Re-enable xunit warning 2004 (dotnet/corefx#39698)
* Replace "Assert.Equal(true, " with "Assert.True("

* Replace "Assert.Equal(false, " with "Assert.False("

And fix a few Assert.Equal(true cases that deal with objects and thus need to be reverted.

* Replace "Assert.StrictEqual(true, " with "Assert.True("

* Revert a few changes where true/false was being compared to object

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/1296bc8386a7283e319ddf723282f16651f9ea5f
2019-07-23 17:05:15 -04:00
Stephen Toub 47f8f6d47d Re-enable xunit warning 2003 (dotnet/corefx#39696)
* Replace "Assert.Equal(null, " with "Assert.Null("

* Replace "Assert.NotEqual(null, " with "Assert.NotNull("

* Replace "Assert.Same(null, " with "Assert.Null("

* Replace "Assert.StrictEqual(null, " with "Assert.Null("


Commit migrated from https://github.com/dotnet/corefx/commit/6de660a02e335eefebfcc3c81ecb0013e2a8148e
2019-07-23 15:49:33 -04:00
Geoff Kizer 074a4f663d Merge pull request dotnet/corefx#39343 from geoffkizer/enableremotetestsforhttp2
ensure remote server HTTP2 tests are actually using HTTP2

Commit migrated from https://github.com/dotnet/corefx/commit/6ec67c15c3f213206e9cf66a2d69d274d3836e6b
2019-07-16 15:09:58 -07:00
Stephen Toub d2c2aba33e Ensure that CancellationToken is propagated to built-in request content types (dotnet/corefx#39474)
* Ensure that CancellationToken is propagated to built-in request content types

We don't currently expose the overload that would allow CancellationToken to be accessed by HttpContent-derived types in general, but we can at least ensure that when using the built-in content types, the CancellationToken provided to SendAsync is appropriately threaded through.  We were doing this previously in only a few cases, where we knew that the previous overload wouldn't be overridden (namely internal types and sealed types), but we can enable the 90% scenario as well by doing a type check at run-time.

* Disable cancellation test for UAP handler


Commit migrated from https://github.com/dotnet/corefx/commit/450f49a1a80663529b31d3defafbd5e59822a16a
2019-07-15 16:17:56 -04:00
Geoff Kizer e89fbd6b5e ensure remote server HTTP2 tests are actually using HTTP2 and modify some remote server tests to run over HTTP2 as well as HTTP/1.1
Commit migrated from https://github.com/dotnet/corefx/commit/f013baadc511567f012d6132f9e710fb3acafb66
2019-07-13 17:17:31 -07:00
Stephen Toub 718d1968e4 Stop disposing of the proxy in HttpConnectionPoolManager.Dispose (dotnet/corefx#38991)
SocketsHttpHandler doesn't own the proxy its given; the lifetime of that proxy is up to the developer supplying it.  We may also end up using a global proxy instance if the developer hasn't explicitly supplied one.  However, SocketsHttpHandler's internal HttpConnectionPoolManager was disposing of this proxy instance on its disposal.  For proxies that implement IDisposable, as our global default proxy does, that can be very problematic; on Windows, our default proxy has a SafeHandle, and once its disposed, every subsequent request to the proxy will fail (an exception gets thrown and then internally eaten). The fix is simply to stop disposing a proxy instance we don't own.

While investigating this, I also made a few style tweaks to WinInetProxyHelper, removing private property setters, so as to better be able to see that certain values were readonly and never changed after construction.

Commit migrated from https://github.com/dotnet/corefx/commit/c6a849b8d24fc48bb0bbdb9f9165752a4a19459b
2019-06-27 19:29:23 -04:00
Jose Perez Rodriguez 275f6d0636 Making Exceptions serializable (dotnet/corefx#38893)
* Making Exceptions serializable

* Remove EventLog serialization exceptions from tests since they won't work on non-Windows platforms

* Fix build and add internal exceptions as well

* Add parameter-less constructor to RethrowException

* Adding PR Feedback

* Fix allConfigurations build


Commit migrated from https://github.com/dotnet/corefx/commit/7075587321a1b6b59248b1a6c7ea04fc803eab96
2019-06-26 11:59:59 -07:00
Viktor Hofer 2862b45d28 Update sln configurations (dotnet/corefx#38698)
Commit migrated from https://github.com/dotnet/corefx/commit/5ec88f81af71d253cfa74f9982abf748ccbd529b
2019-06-19 23:28:19 +02:00
dotnet-maestro[bot] 10f72f160b [master] Update dependencies from dotnet/coreclr (dotnet/corefx#38099)
* Update dependencies from https://github.com/dotnet/coreclr build 20190530.2

- Microsoft.NET.Sdk.IL - 3.0.0-preview6.19280.2
- Microsoft.NETCore.ILAsm - 3.0.0-preview6.19280.2
- Microsoft.NETCore.Runtime.CoreCLR - 3.0.0-preview6.19280.2

* Expose, test, and use Environment.TickCount64

* Back out change to WinInetProxyHelper.cs


Commit migrated from https://github.com/dotnet/corefx/commit/06f25eaa8592b49c65373d0cdcbdac9a4bdf0f35
2019-05-31 13:25:15 -07:00
Viktor Hofer b661c58b1c Replace netstandard test projects with tfms
Netstandard test projects are broken by design and don't support the
Microsoft.Net.Test.SDK. Replacing the netstandard tfm with the concrete
implementation tfms.


Commit migrated from https://github.com/dotnet/corefx/commit/d29c16c99c6045ee67444a7a693dd4476861c463
2019-05-30 16:18:41 +02:00
Jose Perez Rodriguez 7d8177c8c3 Fix VS Configurations for all projects in corefx (dotnet/corefx#37477)
Commit migrated from https://github.com/dotnet/corefx/commit/1c48331eb5784c58b81309665257f454abd7d322
2019-05-06 14:46:10 -07:00
Stephen Toub 9399808614 Log exceptions from asynchronously failing Expect: 100-continue sends (dotnet/corefx#37391)
* Log exceptions from asynchronously failing Expect: 100-continue sends

When Expect: 100-continue is used, the sending of the request body content is allowed to run concurrently with the receipt of the response headers.  If the processing of the response headers encounters an exception, we currently fail to ever join with that send task, which results in a TaskScheduler.UnobservedTaskException event.  This PR changes to observe the exception in such cases and log it.

(In doing so, I also came across an async void method, and changed all of the remaining ones in the assembly to be async Task instead.  The current implementation of async void isn't any cheaper than async Task, and is actually more expensive in certain ways, plus it unnecessarily interacts with any SynchronizationContext that may exist.)

* Address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/0bc3ee4a4f1debaa0dd3c957d5201ae2a47757a1
2019-05-03 17:33:55 -04:00
David Shulman 5ef49c6883 Implement HttpClient.DefaultProxy property (dotnet/corefx#37333)
This PR implements the new static HttpClient.DefaultProxy property which was approved
during API review.

Modify the SystemProxyInfo.ConstructSystemProxy method to a Singleton.

Modify SocketsHttpHandler to use the HttpClient.DefaultProxy property.

Rename the HttpSystemProxy class to HttpWindowsProxy.

Add some HttpClient tests for the new property.

Closes dotnet/corefx#36553


Commit migrated from https://github.com/dotnet/corefx/commit/c661db6ce2da91033671c0000afc185de1ad3fe9
2019-05-01 15:17:21 -07:00
David Shulman 42d1f38c7d Fix SocketsHttpHandler system proxy usage logic (dotnet/corefx#37153)
SocketsHttpHandler was not using the proxy bypass list specified in IE settings in cases where
there is a combination of both 'AutoDetect' and 'Manual' settings in the IE settings dialog.

SocketsHttpHandler uses WinHttpHandler's WinInetProxyHelper class as part of the HttpSystemProxy
class. But it was consuming it in an incorrect way. WinInetProxyHelper was originally written to
be used only with the rest of the WinHTTP stack for WinHttpHandler. When WinHTTP GetProxyForUrl() was returning a ProxyBypass string, HttpSystemProxy was ignoring it. It was
assuming that the string for Proxy was correct. But in cases where ProxyBypass is returned, the
Proxy string is only used if the destination uri doesn't match any of the strings in the ProxyBypass
list. That logic would normally be handled automatically by WinHttpHandler. But HttpSystemProxy
was simply discarding the ProxyBypass string returned by WinHTTP GetProxyForUrl().

In order to address this fix, I added new tests for HttpSystemProxy. I utilized the existing mock
layers for registry and WinHTTP interop that are contained in the WinHttpHandler Unit Tests. It might
seem weird to have tests for the internal HttpSystemProxy class located in the WinHttpHandler folder.
But, we already pull in the source code for WinInetProxyHelper from WinHttpHandler into the
SocketsHttpHandler compilation. Using these Unit Tests with the mocking layers allows us to test a
broad range of scenarios (registry settings and network failures) that are normally difficult to test.
I have a plan, though, to refactor the system proxy code and tests as part of implementing dotnet/corefx#36553.
That will result in the system proxy code and tests ending up in a more logical place.

Fixes dotnet/corefx#33866


Commit migrated from https://github.com/dotnet/corefx/commit/6da9a3b80c2ac56c641fa22157607860f6b9387f
2019-04-25 10:58:44 -07:00
Tanner Gooding 5a5ed7652a Regenerating reference sources in order to reorder enum fields (dotnet/corefx#37045)
Commit migrated from https://github.com/dotnet/corefx/commit/17382def0f680653870c31af1acf086ac41dcc0b
2019-04-23 13:40:45 -07:00
Nikita Potapenko 28f63d6f4e Fix typo (dotnet/corefx#36107)
.Net -> .NET

Commit migrated from https://github.com/dotnet/corefx/commit/d29ae79fb13b4df9078400ac49b460e011f96404
2019-03-17 15:43:21 -07:00
Stephen Toub dce7647bbc Clean up lots of string.Format / SR.Format usage (dotnet/corefx#35777)
* Clean up lots of string.Format usage

This PR does a few things:
- Adds new SR.Format overloads, in particular to support accepting an IFormatProvider as the first argument.
- Fixes a bunch of calls to string.Format that should have been using SR.Format.  This not only helps in AOT builds where we want to be able to more cleanly remove resource strings, it enables easier auditing of the remaining string.Format uses to determine whether there are more appropriate implementations.
- Replaces some string.Format uses, in particular in asserts, with easier to read and maintain string interpolation
- Replaces some string.Format uses with string concatenation where it's simple and cheaper
- Fixes a bunch of SR.Format(SR.Something) calls where the SR.Format part is extraneous and should just be removed.
- Replaces a bunch of Debug.Assert(false, ...) calls with Debug.Fail(...).  This isn't directly related to string.Format, but I started this cleanup as part of cleaning up asserts that were using string.Format, and then ended up accidentally merging the chain into the same commit, and decided it was simple enough that I should just leave it rather than trying to separate it out again.

* Address PR feedback

* Fix breaks due to lower netstandard builds


Commit migrated from https://github.com/dotnet/corefx/commit/a6f76f4f620cbe74821c6445af3f13e048361658
2019-03-06 12:03:00 -08:00
Viktor Hofer f8a8530d0f Project msbuild syntax cleanup (dotnet/corefx#35686)
* Remove license header from non-shipping files

* Remove obsolete Project attributes

* Remove xml header and remove DefaultTargets


Commit migrated from https://github.com/dotnet/corefx/commit/c390ce7df50252e11f5d322276e9d19e046d1332
2019-03-03 18:55:25 +01:00
Ahson Khan 4fed6ab881 Auto-generate the reference assemblies and separate type forwards (dotnet/corefx#35557)
* Auto-generate the reference assemblies

* Add back type forwards.

* Revert "Add back type forwards."

This reverts commit dotnet/corefx@3acf74aabb.

* Add back TypeForwardedTo in .Forward.cs files

* Add new type forward files to the csproj files

* Add back if-defs and move TestUtilities comment from ref to source

* Remove duplicate definitions, delete unnecessary manual files,

* Fix build breaks

* Add back missing AsyncMethodBuilderAttr to S.Runtime ref

* Fix typo between XmlDocument and XPath.XDocument

* Add type forward fild missed from previous commit

* Fix ECDiffieHellmanCngPublicKey internal ctor for netfx 4.6.1

* Remove "this type was moved to comments" from the type forwards.

* Add back the Xml and Debugger* attributes to Xml.ReaderWriter

* Add back struct layout attributes

* Add back attributes missing (highlighted from api compat)

* Add missing toolbox item attribute in s.data.common.

* Add missing struct layout attributes and remove unnecessary additions

* Add back InterfaceTypeAttribute


Commit migrated from https://github.com/dotnet/corefx/commit/16689aa0a933517dc45465fc6edb6223222414a6
2019-02-27 19:39:21 -08:00
Krzysztof Wicher 3ed51b67e9 Fix casing of files to get closer to ./build.sh -allConfiguration working on linux (dotnet/corefx#35085)
* Rename directories to use CamelCasing

* Fix CsProj files to match file names and their casing

* fix couple of Compile items which were not in csproj file


Commit migrated from https://github.com/dotnet/corefx/commit/8c5260061b11323dfd97fbab614d54402405513f
2019-02-07 10:41:44 -08:00
Stephen Toub 8fd85a520b Set ILLinkClearInitLocals across repo
Enable it for all C# src projects.


Commit migrated from https://github.com/dotnet/corefx/commit/4b5b5c163b925400b884dac2bf207d189b69bd3b
2019-01-08 09:49:57 -05:00
Viktor Hofer 66e8f64d31 Consume Microsoft.DotNet.CoreFxTesting package (dotnet/corefx#33423)
* Consume Microsoft.DotNet.CoreFxTesting package

* Remove code coverage dedicated runtime dir config files and switch to Coverlet

* Add global tool support in corefx

* Update code coverage docs

Commit migrated from https://github.com/dotnet/corefx/commit/ae38b7cc3762d832fdcebe27a0aab7b22ab2f3fa
2018-12-06 02:56:11 +01:00
Stephen Toub 72198bb4c9 Finish (mostly) erradicating StringBuilder marshaling from corefx (dotnet/corefx#33780)
* Finish (mostly) erradicating StringBuilder marshaling from corefx

This should finish my quest of removing StringBuilder marshaling from coreclr and corefx, which I've strived to do because it often adds unnecessary overhead and often is done incorrectly because of intricacies in how the marshaling works; while not using it often leads to `unsafe` code at call sites, there's much less magic, and it affords the ability to optimize more if desired.

There are still three remaining [Out] StringBuilder's in Interop.Odbc.cs, which I've not removed because tests are limited and the call graph to these is non-trivial with StringBuilders passed through.  There may also be a few straggling DllImports I missed while scouring interop that's not following our guidelines of being in src\Common\.

Other than those, the remaining StringBuilder usage I found in DllImports was for [In] only, and in those cases it's reasonable, as the call sites are building up StringBuilders and then passing them off to the call sites; converting those to use `char*` or similar could actually make them more expensive.  I did, however, ensure they were properly annotated as [In], in order to make the intent clear and avoid potential marshaling costs for the unnecessary [Out] direction.

Where I was touching a function in one of these stray interop files that was duplicated elsewhere, I also consolidated it to a centralized location, but I've not in this PR done the cleanup work for the rest of the files.

* Address PR feedback

* Address further feedback


Commit migrated from https://github.com/dotnet/corefx/commit/c77984de34e3334734d53c09d5dac7c7471e972d
2018-12-03 20:39:02 -05:00
Jose Perez Rodriguez def4a493e8 Removing Reference assets from packages which contain runtime-specific dependencies when targeting Desktop. (dotnet/corefx#33510)
* Removing Reference assets from packages which contain runtime-specific dependencies when targeting Desktop. (dotnet/corefx#33254)

* Removing Reference assets from packages which contain runtime-specific dependencies when targeting Desktop.

* Adding validation target to catch other instances of packages that need the property

* Fixing target to check all exclude compiles. Undoing changes on two packages that are not required any more.

* Update package index to contain the right versions

* Fixing packaging build errors


Commit migrated from https://github.com/dotnet/corefx/commit/6832425094123c858b9e5da02469c98ca8c200c4
2018-11-16 06:34:34 -08:00
Jeremy Barton cefe07725e Add initial support for TLS 1.3 to .NET Core
* TLS 1.3 connections have been tested on Ubuntu 18.10 (OpenSSL 1.1.1).
* There's no public version of Windows with TLS 1.3 enabled.
* There's no public version of macOS with TLS 1.3 enabled out of the box.

When making use of SslProtocols.None (system default) TLS 1.3 is already working on Ubuntu 18.10, this change mainly makes it so that EncryptionPolicy.None is better handled, and that we can restrict-to and report TLS 1.3.

Commit migrated from https://github.com/dotnet/corefx/commit/d30157d9e48cf73e267994e45953722d18ccd4c6
2018-11-12 17:49:05 -08:00
Wes Haggard 954fb511b3 Rename AssemblyKey properties to StrongNameKeyId as part of arcade work
Commit migrated from https://github.com/dotnet/corefx/commit/7edd861bf2dd59ecdb4284e0fd291d7458198a9d
2018-10-30 15:14:01 -07:00
Sam Neirinck 68b24b8b69 Cleanup MSDN URL's (dotnet/corefx#32663)
* Fix non-https msdn links

* Additional HTTPS treatment


Commit migrated from https://github.com/dotnet/corefx/commit/0bfc4f3cf62f6fc29162ad5b1b89acc14124a375
2018-10-09 11:59:36 -07:00
Santiago Fernandez Madero ccdea37829 Update netfx alias to target .NET 4.7.2 (dotnet/corefx#28883)
* Change netfx to target .NET 4.7.1

* Fix CoreFx.Private.TestUtilities to not reference System.Runtime.InteropServices.RuntimeInformation which is now inbox in netfx

* Fix StackTrace.Tests to be built against netstandard and run against netfx inbox

* Fix ValueTuple configurations to support net461 and add netfx placeholder configuration since in net471 it is now inbox

* Fix projects' package configurations that had netfx (net461) to still support net461 and netfx as a buildconfigurations

* Disable failing tests when running on .NET 4.7.1

* Make netfx target net472 and merge with master

* Update ActiveIssue comments to issue number only

* Workaround packages tests due to not installed targeting pack

* Match NSSupportPackage version to CLI's

* Remove netstandard support lib bin placing to runtime and testhost for netfx, fix reference paths to match new package

* Run UpdateVSConfigurations after merging conflicts with the newly updated SDK projects

* Add net461 package configuration to System.CodeDom

* Add net461 package configuration to System.Configuration.ConfigurationManager

* Add net461 package configuration to System.Security.Cryptography.Xml

* Add net461 package configuration to System.Security.Permissions

* Add net461 package configuration to System.ServiceModel.Syndication


Commit migrated from https://github.com/dotnet/corefx/commit/faad2e63b35bed10fe18195987a413308b97eded
2018-07-10 15:04:27 -07:00
Eric Erhardt 779486884e Merge master into SdkProj
Commit migrated from https://github.com/dotnet/corefx/commit/ec546de620c5248f3662d6aaca989ed382b86b6b
2018-06-28 21:28:41 -05:00
Eric Erhardt 8b6d5baf20 Change .csproj to new Configurations property
Change .sln to use the managed C# project system GUID.


Commit migrated from https://github.com/dotnet/corefx/commit/e05508a62d28f4807f85abe9cb7adf8382f792b4
2018-06-28 17:49:22 -05:00
Stephen Toub 4c9eb2ec25 Simplify built-in types across corefx tests (dotnet/corefx#30660)
Commit migrated from https://github.com/dotnet/corefx/commit/7ae1a252d7e68c5513d2658de7a401c37e9b0504
2018-06-25 22:42:04 -07:00
Stephen Toub 2fb9f847fc Simplify built-in types across corefx (dotnet/corefx#30656)
Commit migrated from https://github.com/dotnet/corefx/commit/e0ba7aa8026280ee3571179cc06431baf1dfaaac
2018-06-25 16:54:41 -07:00
Eric Erhardt 1df03e5bbd Rename dir files to Directory.Build
dir.props => Directory.Build.props
dir.targets => Directory.Build.targets


Commit migrated from https://github.com/dotnet/corefx/commit/204a8dbbc23bfc51d419c93f2f2ddaf50db8020f
2018-06-15 17:07:48 -05:00
Eric Erhardt 70091b9c8b Merge master into SdkProj
Commit migrated from https://github.com/dotnet/corefx/commit/ad505eb98c6a887db2d2932fec256d9e4e394169
2018-06-11 17:20:10 -05:00
David Shulman ad9557d3c4 Fix WinHttpHandler when using authenticating proxies (dotnet/corefx#30196)
This was a regression from .NET Core 2.0 due to PR dotnet/corefx#28105.

Proxy authentication using system default proxy settings that involve a PAC file
(either autodiscovery or explicit PAC file) cause a NullReferenceException in WinHttpHandler in the
CheckResponseForAuthentication() method.

This problem is only discovered when using an authenticating proxy server (any auth scheme) that is
discovered using PAC files. This is considered the "system default" proxy. When this occurs, the
handler's Proxy property is null and dereferencing it caused the exception.

Due to the problems described in dotnet/corefx#6997, the uri of the proxy can't be determined yet since it is only
known to WinHTTP. Fixing dotnet/corefx#6997 is complicated and impacts performance. However, in most cases, as
long as the credentials are a NetworkCredential object, knowing the uri of the proxy is needed.

I tested this manually using the steps I described in dotnet/corefx#30191. I did not add any tests to this PR since
they can't be run in CI. However, I am working on a task that will eventually add Enterprise-Scenario
testing like this (PAC files, authenticating proxies, etc.) to our systems.

Fixes dotnet/corefx#30191
Contributes to dotnet/corefx#6997

Commit migrated from https://github.com/dotnet/corefx/commit/69c2e2072574805589becac0c08590dc5e39b65e
2018-06-07 17:31:30 -07:00
David Shulman 8e11e35537 Fix auto decompression behavior in Http handlers (dotnet/corefx#29903)
Fixed a few bugs in both WinHttpHandler and SocketsHttpHandler regarding the behavior of
'Accept-Encoding' request headers and automatic decompression of response body content.

On Windows 7, native WinHTTP doesn't support automatic decompression. That also means it doesn't automatically append 'Accept-Encoding' request headers. WinHttpHandler was relying on WinHTTP to add those headers. But it wasn't happening on Windows 7. So, now WinHttpHandler will make sure those headers are added if not already present. WinHttpHandler was also always decompressing content even when the encodings in the .AutomaticDecompression property didn't match.

SocketsHttpHandler had a different bug. It would make sure that the 'Accept-Encoding' headers were
present when .AutomaticDecompression was being used. But it wouldn't check for existing headers and duplicate encodings would be present in the outbound 'Accept-Encoding' request header.  I.e., it would end up with "Accept-Encoding: gzip, gzip".

In addition to fixing these bugs, I added more tests to both Http Functional and WinHttpHandler Unit
tests (which can simulate running on Windows 7 using the existing mocks).

Fixes dotnet/corefx#29747
Fixes dotnet/corefx#26991


Commit migrated from https://github.com/dotnet/corefx/commit/40ce4cb20270f731d7d826291e1edce8d1ce2c37
2018-05-25 14:48:26 -07:00
wtgodbe f38ceb30be Convert all .csproj files in src to SDK-style projects
Commit migrated from https://github.com/dotnet/corefx/commit/91d7e62bbf28094a2b419b87847bcd6a7658564d
2018-05-21 11:53:46 -07:00
Stephen Toub 9cf4d3bb85 Merge pull request dotnet/corefx#29636 from stephentoub/formatmessage
Improvements to FormatMessage

Commit migrated from https://github.com/dotnet/corefx/commit/48ce3254e28f2dae2d9a5efe7dd42cfab119d287
2018-05-10 22:27:53 -04:00
David Shulman 280b85f227 Add EventSource tracing to WinHttpHandler (dotnet/corefx#29604)
Add EventSource tracing to WinHttpHandler

Removed the custom OutputDebugString-style tracing from WinHttpHandler and replaced it with
NetEventSource. Didn't define any new event id's but tried to use "Info" vs. "Error"
in more places.

Due to the unique way the WinHttpHandler class gets built into two different binaries,
I needed to add a new EventSource name/GUID for the standalone System.Net.Http.WinHttpHandler.dll
binary. The logging output is similar but will show up in either "Microsoft-System-Net-Http" or
"Microsoft-System-Net-Http-WinHttpHandler" EventSource's depending on which binary is being used,
i.e. whether "new HttpClientHandler()" or "new WinHttpHandler()" was used.

For those curious about how the new GUID for "Microsoft-System-Net-Http-WinHttpHandler" was done, it
was not generated randomly. EventSource GUID's are generated based on the string name for the
EventSource according to a well-defined formula. Doing a construct like this will return back the
information:

```c#
Type esType = typeof(WinHttpHandler).GetTypeInfo().Assembly.GetType("System.Net.NetEventSource", true, false);
Console.WriteLine($"Name={EventSource.GetName(esType)}, Guid={EventSource.GetGuid(esType).ToString()}");
```

Closes dotnet/corefx#7856


Commit migrated from https://github.com/dotnet/corefx/commit/11222269ae3bc45cd414dcb973f2d92f1bad73f8
2018-05-10 14:33:25 -07:00
Stephen Toub 4dbf9094c2 Use FORMAT_MESSAGE_ALLOCATE_BUFFER with FormatMessage
Avoid looping and growing a managed heap buffer when we can instead just ask the native side to allocate one of the right size for us.


Commit migrated from https://github.com/dotnet/corefx/commit/e118304d264163f03e79965e4f2ab1d5c1a43961
2018-05-10 16:38:16 -04:00
Stephen Toub 4dafdf5211 Replace shared Interop.FormatMessage.cs with non-shared one
Commit migrated from https://github.com/dotnet/corefx/commit/f3414d6cc3463b9e243e5d732d7e401c2d037d05
2018-05-10 16:03:31 -04:00
David Shulman 264474f8a3 Removed duplicated type HttpVersionInternal (dotnet/corefx#29545)
Removed duplicated type HttpVersionInternal

We added HttpVersionInternal back when it differed from the System.Net.Primitives HttpVersion type. But now that the two types are the same, we can remove the duplicated internal type.

Fixes dotnet/corefx#26492


Commit migrated from https://github.com/dotnet/corefx/commit/40faa4ed5c699e84afbb78f6ff96feb7b99db320
2018-05-07 14:00:19 -07:00
Dan Friedman 33591df321 Clean dead code System.Net* (dotnet/corefx#29302)
* Clean dead code in System.Net

* More cleaning

* Clean dead code for HttpListener

* Clean dead code for Mail

* Clean dead code in Http

* Clean dead code for NetworkInformation

* Clean more dead code

* Various fixes

* Build fix

* Restore field

* var -> string


Commit migrated from https://github.com/dotnet/corefx/commit/71cc1ae8ba02b7b71878cb69a50c667c8ed0f50f
2018-05-01 16:49:12 -07:00
Wes Haggard fc526e8605 Bump assembly versions for libraries with packages
Commit migrated from https://github.com/dotnet/corefx/commit/6a1b5c0aeee747a535579da7374c05b8d878fb65
2018-04-27 14:56:18 -07:00
Marco Rossignoli 87da9705a6 De-duplicate resource ID's to make Mono merge easier (dotnet/corefx#29280)
* wip

* wip

* wip

* fix System.Linq.Expressions

* revert for tests

* add powershell script

* address PR feedback

* address PR feedbacl

* address PR feedback


Commit migrated from https://github.com/dotnet/corefx/commit/5a37188238e90d8566e6161b43ac483a671bb7d2
2018-04-24 13:58:42 -07:00
Marco Rossignoli 528e91dabf Replace identical files with CoreLib mirror (dotnet/corefx#28593)
Commit migrated from https://github.com/dotnet/corefx/commit/5041dbb272ae05b360db538cf62fc2847277fd7e
2018-04-17 16:05:44 -07:00