Skip to content

Commit df60bf7

Browse files
ViktorHoferwtgodbe
authored andcommitted
Only build the target platform in native projs for the VMR
1 parent f470910 commit df60bf7

File tree

7 files changed

+34
-63
lines changed

7 files changed

+34
-63
lines changed

eng/Build.props

+7
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@
5656
$(RepoRoot)src\SignalR\perf\benchmarkapps\**\*.csproj;
5757
" />
5858

59+
<!-- In the VMR, we don't build the native ANCM bits in pass 1 -->
60+
<ProjectToExclude Include="
61+
$(RepoRoot)src\Installers\**\*.vcxproj;
62+
"
63+
Condition=" '$(BuildNative)' == 'true' and '$(DotNetBuild)' == 'true' and ('$(DotNetBuildPass)' == '' or '$(DotNetBuildPass)' == '1') " />
64+
65+
5966
<!-- This project requires inputs from x64, x86, and arm64 on Windows - therefore in the VMR, we build it in pass 2 -->
6067
<ProjectToExclude Include="
6168
$(RepoRoot)src\Servers\IIS/IntegrationTesting.IIS\src\Microsoft.AspNetCore.Server.IntegrationTesting.IIS.csproj;

eng/Common.props

+4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
<TargetOsName Condition=" '$(TargetOsName)' == '' AND $([MSBuild]::IsOSPlatform('OSX'))">osx</TargetOsName>
55
<TargetOsName Condition=" '$(TargetOsName)' == '' AND $([MSBuild]::IsOSPlatform('Linux'))">linux</TargetOsName>
66
<TargetOsName Condition=" '$(TargetOsName)' == '' AND $([MSBuild]::IsOSPlatform('FreeBSD'))">freebsd</TargetOsName>
7+
78
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">x64</TargetArchitecture>
9+
<NativePlatform>$(TargetArchitecture)</NativePlatform>
10+
<NativePlatform Condition=" '$(NativePlatform)' == 'x86' ">Win32</NativePlatform>
11+
812
<TargetRuntimeIdentifier Condition="'$(TargetRuntimeIdentifier)' == ''">$(TargetOsName)-$(TargetArchitecture)</TargetRuntimeIdentifier>
913
<PortableBuild Condition="'$(PortableBuild)' == ''">true</PortableBuild>
1014
<DefaultAppHostRuntimeIdentifier Condition=" '$(DotNetBuild)' == 'true' ">$(TargetRuntimeIdentifier)</DefaultAppHostRuntimeIdentifier>

src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.Composite.sfxproj

-4
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@
7070
</Target>
7171

7272
<!-- Add native dependencies to the package when required. -->
73-
<PropertyGroup>
74-
<NativePlatform>$(TargetArchitecture)</NativePlatform>
75-
<NativePlatform Condition=" '$(NativePlatform)' == 'x86' ">Win32</NativePlatform>
76-
</PropertyGroup>
7773
<ItemGroup>
7874
<ProjectReference Condition=" '$(UseIisNativeAssets)' == 'true' AND $(BuildNative) AND '$(MSBuildRestoreSessionId)' == ''"
7975
Include="$(RepoRoot)src\Servers\IIS\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj">

src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.sfxproj

-4
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,6 @@
6868
</ItemGroup>
6969

7070
<!-- Add native dependencies to the package when required. -->
71-
<PropertyGroup>
72-
<NativePlatform>$(TargetArchitecture)</NativePlatform>
73-
<NativePlatform Condition=" '$(NativePlatform)' == 'x86' ">Win32</NativePlatform>
74-
</PropertyGroup>
7571
<ItemGroup>
7672
<ProjectReference Condition=" '$(UseIisNativeAssets)' == 'true' AND $(BuildNative) AND '$(MSBuildRestoreSessionId)' == ''"
7773
Include="$(RepoRoot)src\Servers\IIS\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj">

src/Installers/Windows/AspNetCoreModule-Setup/ANCMIISExpressV2/ancm_iis_expressv2.wxs

-51
Original file line numberDiff line numberDiff line change
@@ -274,52 +274,6 @@
274274
</Component>
275275
</Directory>
276276
</Directory>
277-
278-
<!-- WOW64 Support -->
279-
<?if $(var.Platform) != "x86" ?>
280-
<Directory Id="$(var.ProgramFilesFolder32)">
281-
<Directory Id="INSTALLDIR32" Name="IIS Express" >
282-
<Directory Id="INSTALLLOCATION32" ShortName="ANCM" Name="$(var.ProductName)">
283-
<Directory Id="VersionDir32" Name="$(var.ProductVersionString)">
284-
<!-- Originally created with same component GUID as IIS installer. Must remain the same so upgrade doesn't remove this file -->
285-
<Component Id="AspNetCoreModule.wow" Guid="45ba5011-a619-4d06-8a8d-155b1f9732b3" Win64="no">
286-
<File Id="AspNetCoreModuleDll.wow"
287-
Name="aspnetcorev2.dll"
288-
Source="$(var.ArtifactsDir)\bin\AspNetCoreModuleShim\Win32\$(var.Configuration)\aspnetcorev2.dll"
289-
DiskId="1"
290-
Vital="yes">
291-
</File>
292-
<RegistryKey Root="HKLM" Key="SYSTEM\CurrentControlSet\Services\EventLog\Application\$(var.ProductShortName)">
293-
<RegistryValue Name="EventMessageFile" Type="expandable" Value="[#AspNetCoreModuleDll.wow]"/>
294-
<RegistryValue Name="TypesSupported" Type="integer" Value="7"/>
295-
</RegistryKey>
296-
</Component>
297-
<Directory Id="HandlerVersionDir32" Name="$(var.ANCMFolderVersion)" >
298-
<Component Id="AspNetCoreModuleHandler.wow" Guid="0A8EDB50-7D85-4825-8010-D27EFAF061B6" Win64="no">
299-
<File Id="AspNetCoreModuleHandlerDll.wow"
300-
Name="aspnetcorev2_outofprocess.dll"
301-
Source="$(var.ArtifactsDir)\bin\OutOfProcessRequestHandler\Win32\$(var.Configuration)\aspnetcorev2_outofprocess.dll"
302-
DiskId="1"
303-
Vital="yes">
304-
</File>
305-
</Component>
306-
</Directory>
307-
</Directory>
308-
</Directory>
309-
<Directory Id="IISConfigDir.wow" Name="config">
310-
<Directory Id="IISSchemaDir.wow" Name="schema">
311-
<Component Id="AspNetCoreSchema.wow" Guid="$(var.SchemaGuid32)" Win64="no" >
312-
<File Id="AspNetCoreSchemaFile.wow"
313-
Name="aspnetcore_schema_v2.xml"
314-
Source="$(var.AspNetCoreSchemaPath)"
315-
DiskId="1"
316-
Vital="yes"/>
317-
</Component>
318-
</Directory>
319-
</Directory>
320-
</Directory>
321-
</Directory>
322-
<?endif?>
323277
</DirectoryRef>
324278

325279
<!-- Feature Definition -->
@@ -336,11 +290,6 @@
336290
<ComponentRef Id="AspNetCoreModuleHandler"/>
337291
<?endif ?>
338292
<ComponentRef Id="AspNetCoreSchema"/>
339-
<?if $(var.Platform) != "x86" ?>
340-
<ComponentRef Id="AspNetCoreModule.wow"/>
341-
<ComponentRef Id="AspNetCoreModuleHandler.wow"/>
342-
<ComponentRef Id="AspNetCoreSchema.wow"/>
343-
<?endif ?>
344293
</Feature>
345294

346295
<!-- User Interface -->

src/Installers/Windows/AspNetCoreModule-Setup/Directory.Build.props

+18-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</DefineConstants>
4141
</PropertyGroup>
4242

43-
<ItemGroup Condition="'$(BuildNative)' == 'true'">
43+
<ItemGroup Condition="'$(BuildNative)' == 'true' AND ('$(DotNetBuild)' != 'true' OR '$(DotNetBuildPass)' == '2') ">
4444
<ProjectReference Include="$(_ServerIISBasePath)AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj">
4545
<Name>AspNetCoreV2</Name>
4646
<Private>True</Private>
@@ -87,6 +87,23 @@
8787
</ProjectReference>
8888
</ItemGroup>
8989

90+
<ItemGroup Condition="'$(BuildNative)' == 'true' AND '$(DotNetBuild)' == 'true' AND '$(DotNetBuildPass)' != '2' ">
91+
<ProjectReference Include="$(_ServerIISBasePath)AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj">
92+
<Name>AspNetCoreV2</Name>
93+
<Private>True</Private>
94+
<DoNotHarvest>True</DoNotHarvest>
95+
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
96+
<SetPlatform>Platform=$(NativePlatform)</SetPlatform>
97+
</ProjectReference>
98+
<ProjectReference Include="$(_ServerIISBasePath)AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj">
99+
<Name>AspNetCoreV2Handler</Name>
100+
<Private>True</Private>
101+
<DoNotHarvest>True</DoNotHarvest>
102+
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
103+
<SetPlatform>Platform=$(NativePlatform)</SetPlatform>
104+
</ProjectReference>
105+
</ItemGroup>
106+
90107
<Target Name="CopyANCM" BeforeTargets="_PrepareForBuild" Condition=" '$(BuildNative)' != 'true' ">
91108
<ItemGroup>
92109
<None Include="%(RunShimComponents.DllLocation)" CopyToOutputDirectory="PreserveNewest" Condition="Exists('%(RunShimComponents.DllLocation)')" Link="%(RunShimComponents.Platform)\%(RunShimComponents.NativeAsset).dll" />

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@
4545
</Target>
4646

4747
<ItemGroup Condition=" '$(UseIisNativeAssets)' == 'true' ">
48-
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj" Platform="x64" />
49-
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj" Platform="Win32" />
50-
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj" Platform="ARM64" />
48+
<!-- Only build the target platform for product build (DotNetBuild=true). -->
49+
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj" Platform="x64" Condition="'$(DotNetBuild)' != 'true'" />
50+
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj" Platform="Win32" Condition="'$(DotNetBuild)' != 'true'" />
51+
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj" Platform="ARM64" Condition="'$(DotNetBuild)' != 'true'" />
52+
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj" Platform="$(NativePlatform)" Condition="'$(DotNetBuild)' == 'true'" />
5153

5254
<UpToDateCheckInput Include="$(AspNetCoreModuleV2InProcessHandlerDll)" />
5355
</ItemGroup>

0 commit comments

Comments
 (0)