diff --git a/build/runtimes.props b/build/runtimes.props index 37259f3135..50b5a3f111 100644 --- a/build/runtimes.props +++ b/build/runtimes.props @@ -1,7 +1,7 @@ - + 5.3.0 8.1.4 - 0.8.0-preview-20190204.1 + 0.10.0-preview-20190325.1 2.1.1 2.2.0 diff --git a/src/Components/Blazor/Build/test/RuntimeDependenciesResolverTest.cs b/src/Components/Blazor/Build/test/RuntimeDependenciesResolverTest.cs index 8f00691a28..53597ad893 100644 --- a/src/Components/Blazor/Build/test/RuntimeDependenciesResolverTest.cs +++ b/src/Components/Blazor/Build/test/RuntimeDependenciesResolverTest.cs @@ -90,7 +90,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test "System.Data.dll", "System.Diagnostics.Debug.dll", "System.Diagnostics.Tracing.dll", - "System.Drawing.dll", + "System.Drawing.Common.dll", "System.IO.Compression.dll", "System.IO.Compression.FileSystem.dll", "System.Linq.dll", diff --git a/src/Components/Blazor/testassets/MonoSanityClient/Examples.cs b/src/Components/Blazor/testassets/MonoSanityClient/Examples.cs index 8023ded4d9..91d8ede394 100644 --- a/src/Components/Blazor/testassets/MonoSanityClient/Examples.cs +++ b/src/Components/Blazor/testassets/MonoSanityClient/Examples.cs @@ -11,6 +11,14 @@ namespace MonoSanityClient { public static class Examples { + static Examples() + { + // We have to populate GetHttpMessageHandler with something (like the real + // Blazor web assembly host does), otherwise HttpClientHandler's constructor + // gets into an infinite loop. + FakeHttpMessageHandler.Attach(); + } + public static string AddNumbers(int a, int b) => (a + b).ToString(); diff --git a/src/Components/Blazor/testassets/MonoSanityClient/FakeHttpMessageHandler.cs b/src/Components/Blazor/testassets/MonoSanityClient/FakeHttpMessageHandler.cs new file mode 100644 index 0000000000..b1508f01b1 --- /dev/null +++ b/src/Components/Blazor/testassets/MonoSanityClient/FakeHttpMessageHandler.cs @@ -0,0 +1,26 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Net.Http; +using System.Reflection; +using System.Threading; +using System.Threading.Tasks; + +namespace MonoSanityClient +{ + class FakeHttpMessageHandler : HttpMessageHandler + { + public static void Attach() + { + var getHttpMessageHandlerField = typeof(HttpClient).GetField( + "GetHttpMessageHandler", + BindingFlags.Static | BindingFlags.NonPublic); + Func handlerFactory = () => new FakeHttpMessageHandler(); + getHttpMessageHandlerField.SetValue(null, handlerFactory); + } + + protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) + => throw new NotImplementedException($"{nameof(FakeHttpMessageHandler)} cannot {nameof(SendAsync)}."); + } +}