parent
af512861b2
commit
341cd25e05
|
|
@ -1,7 +1,7 @@
|
||||||
<Project>
|
<Project>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<!-- Workaround https://github.com/aspnet/AspNetCore/issues/6726. Required because illink (part of Microsoft.AspNetCore.Blazor.Mono) depends on .NET Core 2.x -->
|
<!-- BaselineGenerator is netcoreapp2.1. Other build tools may also require 2.x. -->
|
||||||
<DotNetCoreRuntime Include="2.2.1" />
|
<DotNetCoreRuntime Include="2.2.1" />
|
||||||
|
|
||||||
<DotNetCoreRuntime Include="$(MicrosoftNETCoreAppPackageVersion)"
|
<DotNetCoreRuntime Include="$(MicrosoftNETCoreAppPackageVersion)"
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@
|
||||||
<SystemIdentityModelTokensJwtPackageVersion>5.3.0</SystemIdentityModelTokensJwtPackageVersion>
|
<SystemIdentityModelTokensJwtPackageVersion>5.3.0</SystemIdentityModelTokensJwtPackageVersion>
|
||||||
<WindowsAzureStoragePackageVersion>8.1.4</WindowsAzureStoragePackageVersion>
|
<WindowsAzureStoragePackageVersion>8.1.4</WindowsAzureStoragePackageVersion>
|
||||||
<!-- Dependencies for Blazor. -->
|
<!-- Dependencies for Blazor. -->
|
||||||
<MicrosoftAspNetCoreBlazorMonoPackageVersion>0.8.0-preview-20190204.1</MicrosoftAspNetCoreBlazorMonoPackageVersion>
|
<MicrosoftAspNetCoreBlazorMonoPackageVersion>0.10.0-preview-20190325.1</MicrosoftAspNetCoreBlazorMonoPackageVersion>
|
||||||
<!-- Packages from 2.1/2.2 branches used for site extension build -->
|
<!-- Packages from 2.1/2.2 branches used for site extension build -->
|
||||||
<MicrosoftAspNetCoreAzureAppServicesSiteExtension21PackageVersion>2.1.1</MicrosoftAspNetCoreAzureAppServicesSiteExtension21PackageVersion>
|
<MicrosoftAspNetCoreAzureAppServicesSiteExtension21PackageVersion>2.1.1</MicrosoftAspNetCoreAzureAppServicesSiteExtension21PackageVersion>
|
||||||
<MicrosoftAspNetCoreAzureAppServicesSiteExtension22PackageVersion>2.2.0</MicrosoftAspNetCoreAzureAppServicesSiteExtension22PackageVersion>
|
<MicrosoftAspNetCoreAzureAppServicesSiteExtension22PackageVersion>2.2.0</MicrosoftAspNetCoreAzureAppServicesSiteExtension22PackageVersion>
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
||||||
"System.Data.dll",
|
"System.Data.dll",
|
||||||
"System.Diagnostics.Debug.dll",
|
"System.Diagnostics.Debug.dll",
|
||||||
"System.Diagnostics.Tracing.dll",
|
"System.Diagnostics.Tracing.dll",
|
||||||
"System.Drawing.dll",
|
"System.Drawing.Common.dll",
|
||||||
"System.IO.Compression.dll",
|
"System.IO.Compression.dll",
|
||||||
"System.IO.Compression.FileSystem.dll",
|
"System.IO.Compression.FileSystem.dll",
|
||||||
"System.Linq.dll",
|
"System.Linq.dll",
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,14 @@ namespace MonoSanityClient
|
||||||
{
|
{
|
||||||
public static class Examples
|
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)
|
public static string AddNumbers(int a, int b)
|
||||||
=> (a + b).ToString();
|
=> (a + b).ToString();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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<HttpMessageHandler> handlerFactory = () => new FakeHttpMessageHandler();
|
||||||
|
getHttpMessageHandlerField.SetValue(null, handlerFactory);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
|
||||||
|
=> throw new NotImplementedException($"{nameof(FakeHttpMessageHandler)} cannot {nameof(SendAsync)}.");
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue