Skip to content

Commit de954ce

Browse files
authored
Fixing IIS Tests (#5682)
1 parent 03cb4a6 commit de954ce

File tree

12 files changed

+37
-12
lines changed

12 files changed

+37
-12
lines changed

build/dependencies.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
<MicrosoftAspNetCoreAspNetCoreModuleStablePackageVersion>2.2.0</MicrosoftAspNetCoreAspNetCoreModuleStablePackageVersion>
131131
<MicrosoftAspNetCoreAspNetCoreModuleV2StablePackageVersion>2.2.0</MicrosoftAspNetCoreAspNetCoreModuleV2StablePackageVersion>
132132
<MicrosoftAspNetIdentityEntityFrameworkPackageVersion>2.2.1</MicrosoftAspNetIdentityEntityFrameworkPackageVersion>
133+
<MicrosoftAspNetCoreServerIISStablePackageVersion>2.2.0</MicrosoftAspNetCoreServerIISStablePackageVersion>
133134
<MicrosoftAspNetWebApiClientPackageVersion>5.2.6</MicrosoftAspNetWebApiClientPackageVersion>
134135
<MicrosoftAzureDocumentDBCorePackageVersion>1.7.1</MicrosoftAzureDocumentDBCorePackageVersion>
135136
<MicrosoftAzureKeyVaultPackageVersion>2.3.2</MicrosoftAzureKeyVaultPackageVersion>

src/DefaultBuilder/test/Microsoft.AspNetCore.FunctionalTests/Microsoft.AspNetCore.FunctionalTests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
<Reference Include="Microsoft.AspNetCore" />
1919
<Reference Include="Microsoft.AspNetCore.Server.IntegrationTesting" />
2020
<Reference Include="Microsoft.AspNetCore.Server.IntegrationTesting.IIS" />
21+
<Reference Include="Microsoft.Extensions.Logging.Testing" />
2122
</ItemGroup>
2223
</Project>

src/Servers/IIS/ResolveIisReferences.targets

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ with the right MSBuild incantations to get output copied to the right place.
1616
<ItemGroup Condition=" '@(Reference->AnyHaveMetadataValue('Identity', 'AspNetCoreModuleV2'))' == 'true' ">
1717
<Reference Remove="AspNetCoreModuleV2" />
1818
<NativeProjectReference Include="$(MSBuildThisFileDirectory)src\AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj" />
19-
<NativeProjectReference Include="$(MSBuildThisFileDirectory)src\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj" />
19+
<NativeProjectReference Include="$(MSBuildThisFileDirectory)src\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj" HandlerPath="2.0.0" />
2020
<NativeProjectReference Include="$(MSBuildThisFileDirectory)src\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj" />
2121
</ItemGroup>
2222

@@ -26,7 +26,7 @@ with the right MSBuild incantations to get output copied to the right place.
2626
<!-- Set the arch-->
2727
<SetPlatform>Platform=x64</SetPlatform>
2828
<!-- The base path for the output. -->
29-
<LinkBase>x64\</LinkBase>
29+
<LinkBase>x64\%(HandlerPath)\</LinkBase>
3030
<!-- This reference assembly doesn't need -->
3131
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
3232
<!-- NativeContent is a custom type of item group which is assigned a target path after project references are resolved. -->
@@ -48,7 +48,7 @@ with the right MSBuild incantations to get output copied to the right place.
4848
<!-- Set the arch-->
4949
<SetPlatform>Platform=x86</SetPlatform>
5050
<!-- The base path for the output. -->
51-
<LinkBase>x86\</LinkBase>
51+
<LinkBase>x86\%(HandlerPath)\</LinkBase>
5252
<!-- This reference assembly doesn't need -->
5353
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
5454
<!-- NativeContent is a custom type of item group which is assigned a target path after project references are resolved. -->

src/Servers/IIS/src/Microsoft.AspNetCore.Server.IIS/Microsoft.AspNetCore.Server.IIS.csproj

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,16 @@
1919
<Content Include="$(PackageId).targets" PackagePath="build/$(TargetFramework)/" />
2020
</ItemGroup>
2121

22+
<Target Name="ValidateNativeComponentsBuilt" AfterTargets="Build" >
23+
<Error Text="Required dll from ANCM has not been built. To build ANCM, you must use MSBuild.exe."
24+
Condition="'$(OS)' == 'Windows_NT' AND !Exists('$(AspNetCoreModuleV2InProcessHandlerDll)')" />
25+
</Target>
26+
27+
<ItemGroup Condition="'$(OS)' == 'Windows_NT' AND '$(VCTargetsPath)' != ''">
28+
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj" />
29+
</ItemGroup>
30+
2231
<ItemGroup>
23-
<Reference Include="AspNetCoreModule" Condition="'$(OS)' == 'Windows_NT'" />
24-
<Reference Include="AspNetCoreModuleV2" Condition="'$(OS)' == 'Windows_NT'" />
2532
<Reference Include="Microsoft.AspNetCore.Authentication.Core" />
2633
<Reference Include="Microsoft.AspNetCore.Connections.Abstractions" />
2734
<Reference Include="Microsoft.AspNetCore.Hosting.Abstractions" />

src/Servers/IIS/src/Microsoft.AspNetCore.Server.IntegrationTesting.IIS/Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,25 @@
1313
<IsPackable>false</IsPackable>
1414
</PropertyGroup>
1515

16+
<Import Project="..\..\build\assets.props" />
17+
1618
<ItemGroup>
1719
<EmbeddedResource Include="Http.config" />
1820
</ItemGroup>
1921

22+
<Target Name="ValidateNativeComponentsBuilt" AfterTargets="Build" Condition="'$(OS)' == 'Windows_NT'">
23+
<Error Text="Required dll from ANCM has not been built. To build ANCM, you must use MSBuild.exe."
24+
Condition="!Exists('$(AspNetCoreModuleV1ShimDll)')
25+
OR !Exists('$(AspNetCoreModuleV2ShimDll)')
26+
OR !Exists('$(AspNetCoreModuleV2OutOfProcessHandlerDll)')" />
27+
</Target>
28+
29+
<ItemGroup Condition="'$(OS)' == 'Windows_NT' AND '$(VCTargetsPath)' != ''">
30+
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\AspNetCoreModuleV1\AspNetCore\AspNetCore.vcxproj" />
31+
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj" />
32+
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj" HandlerPath="2.0.0" />
33+
</ItemGroup>
34+
2035
<ItemGroup>
2136
<ProjectReference Include="$(RepositoryRoot)src\Hosting\Server.IntegrationTesting\src\Microsoft.AspNetCore.Server.IntegrationTesting.csproj" />
2237
<Reference Include="Microsoft.NETCore.Windows.ApiSets" />

src/Servers/IIS/test/Common.FunctionalTests/Utilities/Helpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public static class Helpers
2525

2626
public static string GetTestWebSitePath(string name)
2727
{
28-
return Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"),"test", "WebSites", name);
28+
return Path.Combine(TestPathUtilities.GetSolutionRootDirectory("IISIntegration"),"test", "testassets", name);
2929
}
3030

3131
public static string GetInProcessTestSitesPath()

src/Servers/IIS/test/Common.FunctionalTests/Utilities/IISTestSiteFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public IISTestSiteFixture() : this(_ => { })
5050
{
5151
}
5252

53-
public IISTestSiteFixture(Action<IISDeploymentParameters> configure)
53+
internal IISTestSiteFixture(Action<IISDeploymentParameters> configure)
5454
{
5555
var logging = AssemblyTestLog.ForAssembly(typeof(IISTestSiteFixture).Assembly);
5656
_loggerFactory = logging.CreateLoggerFactory(null, nameof(IISTestSiteFixture));

src/Servers/IIS/test/IIS.BackwardsCompatibility.FunctionalTests/BackwardsCompatibilityTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public async Task CheckBackwardsCompatibilityIsUsed()
2929
{
3030
if (handle.ModuleName == "aspnetcorev2.dll")
3131
{
32-
Assert.Equal("12.2.18287.0", handle.FileVersionInfo.FileVersion);
32+
Assert.Equal("12.2.18316.0", handle.FileVersionInfo.FileVersion);
3333
return;
3434
}
3535
}

src/Servers/IIS/test/IIS.ForwardsCompatibility.FunctionalTests/ForwardsCompatibilityTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public async Task CheckForwardsCompatibilityIsUsed()
2828
{
2929
if (handle.ModuleName == "aspnetcorev2_inprocess.dll")
3030
{
31-
Assert.Equal("12.2.18287.0", handle.FileVersionInfo.FileVersion);
31+
Assert.Equal("12.2.18316.0", handle.FileVersionInfo.FileVersion);
3232
return;
3333
}
3434
}

src/Servers/IIS/test/IIS.Tests/Utilities/TestServer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ public class TestServer: IDisposable, IStartup
3131
private const string HWebCoreDll = "hwebcore.dll";
3232

3333
internal static string HostableWebCoreLocation => Environment.ExpandEnvironmentVariables($@"%windir%\system32\inetsrv\{HWebCoreDll}");
34-
internal static string BasePath => Path.GetDirectoryName(new Uri(typeof(TestServer).Assembly.CodeBase).AbsolutePath);
34+
internal static string BasePath => Path.Combine(Path.GetDirectoryName(new Uri(typeof(TestServer).Assembly.CodeBase).AbsolutePath),
35+
Environment.Is64BitProcess ? "x64" : "x86");
3536

3637
internal static string AspNetCoreModuleLocation => Path.Combine(BasePath, AspNetCoreModuleDll);
3738

0 commit comments

Comments
 (0)