Changed net46 to net461 as some packages have issues.
This commit is contained in:
Родитель
4d91ca68aa
Коммит
699247917b
|
@ -2,8 +2,8 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<VersionPrefix>2.0.0</VersionPrefix>
|
||||
<TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
|
||||
<RuntimeIdentifier Condition=" '$(TargetFramework)' == 'net46' ">win7-x86</RuntimeIdentifier>
|
||||
<TargetFrameworks>net461;netcoreapp2.0</TargetFrameworks>
|
||||
<RuntimeIdentifier Condition=" '$(TargetFramework)' == 'net461' ">win7-x86</RuntimeIdentifier>
|
||||
<DelaySign>true</DelaySign>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
<AssemblyName>EmptyApp20.FunctionalTests</AssemblyName>
|
||||
|
@ -16,6 +16,7 @@
|
|||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\test\$(MSBuildProjectName)</OutputPath>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DependsOnNETStandard Condition=" '$(TargetFramework)' == 'net461'">true</DependsOnNETStandard>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
|
@ -23,11 +24,13 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20170106-08" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
|
||||
<PackageReference Condition=" '$(TargetFramework)' != 'net46' " Include="Microsoft.AspNetCore.Diagnostics" Version="2.0.0" />
|
||||
<PackageReference Condition=" '$(TargetFramework)' == 'net461' " Include="NETStandard.Library.NETFramework" Version="2.0.0-preview2-25405-01" />
|
||||
<!-- <PackageReference Condition=" '$(TargetFramework)' == 'net461' " Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" /> -->
|
||||
<PackageReference Condition=" '$(TargetFramework)' != 'net461' " Include="Microsoft.AspNetCore.Diagnostics" Version="2.0.0" />
|
||||
<PackageReference Include="xunit" Version="2.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net46' ">
|
||||
<ItemGroup Condition=" '$(TargetFramework)' == 'net461' ">
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
</ItemGroup>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
[Fact]
|
||||
public void TestIfPerformanceCountersAreCollected()
|
||||
{
|
||||
#if NET451 || NET46
|
||||
#if NET451 || NET461
|
||||
ValidatePerformanceCountersAreCollected(assemblyName);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -25,9 +25,7 @@
|
|||
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
#if !NET46
|
||||
app.UseDeveloperExceptionPage();
|
||||
#endif
|
||||
app.Use(next =>
|
||||
{
|
||||
return async context =>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<VersionPrefix>1.0.2</VersionPrefix>
|
||||
<TargetFrameworks>net46;netstandard2.0</TargetFrameworks>
|
||||
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
|
||||
<DelaySign>true</DelaySign>
|
||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||
<AssemblyName>FunctionalTestUtils20</AssemblyName>
|
||||
|
@ -12,6 +12,7 @@
|
|||
<PackageId>FunctionalTestUtils</PackageId>
|
||||
<NetStandardImplicitPackageVersion>1.6.1</NetStandardImplicitPackageVersion>
|
||||
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\test\$(MSBuildProjectName)</OutputPath>
|
||||
<DependsOnNETStandard Condition=" '$(TargetFramework)' == 'net461'">true</DependsOnNETStandard>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -19,6 +20,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Condition=" '$(TargetFramework)' == 'net461' " Include="NETStandard.Library.NETFramework" Version="2.0.0-preview2-25405-01" />
|
||||
<PackageReference Condition=" '$(TargetFramework)' == 'net46' " Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.0.3" />
|
||||
<PackageReference Condition=" '$(TargetFramework)' != 'net46' " Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.0.0" />
|
||||
<PackageReference Condition=" '$(TargetFramework)' != 'net46' " Include="Microsoft.AspNetCore" Version="2.0.0" />
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
using System.IO;
|
||||
using Microsoft.ApplicationInsights.Channel;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.AspNetCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
// a variant of aspnet/Hosting/test/Microsoft.AspNetCore.Hosting.Tests/HostingEngineTests.cs
|
||||
public class InProcessServer : IDisposable
|
||||
|
@ -49,19 +48,12 @@
|
|||
|
||||
private BackTelemetryChannel Start(string assemblyName)
|
||||
{
|
||||
|
||||
#if NET46
|
||||
var builder = new WebHostBuilder()
|
||||
.UseContentRoot(Directory.GetCurrentDirectory())
|
||||
.UseUrls(this.BaseHost)
|
||||
.UseUrls(this.BaseHost)
|
||||
.UseKestrel()
|
||||
.UseStartup(assemblyName)
|
||||
.UseEnvironment("Production");
|
||||
#else
|
||||
|
||||
var builder = WebHost.CreateDefaultBuilder().UseStartup(assemblyName);
|
||||
#endif
|
||||
|
||||
if (configureHost != null)
|
||||
{
|
||||
builder = configureHost(builder);
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Xunit;
|
||||
#if NET451 || NET46
|
||||
#if NET451 || NET461
|
||||
using System.Net;
|
||||
using Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector;
|
||||
using Microsoft.ApplicationInsights.Extensibility;
|
||||
|
@ -113,13 +113,13 @@
|
|||
&& d.ResultCode == expected.ResultCode);
|
||||
Assert.NotNull(dependencyTelemetry);
|
||||
|
||||
#if !NET451
|
||||
#if !NET461
|
||||
var requestTelemetry = server.BackChannel.Buffer.OfType<RequestTelemetry>().Single();
|
||||
Assert.Equal(requestTelemetry.Context.Operation.ParentId, dependencyTelemetry.Id);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if NET451 || NET46
|
||||
#if NET451 || NET461
|
||||
public void ValidatePerformanceCountersAreCollected(string assemblyName, Func<IWebHostBuilder, IWebHostBuilder> configureHost = null)
|
||||
{
|
||||
using (var server = new InProcessServer(assemblyName, configureHost))
|
||||
|
|
Загрузка…
Ссылка в новой задаче