Skip to content

BuildIisNativeProjects -> UseIisNativeAssets #39655

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 2 commits into from
Jan 21, 2022
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
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
<MvcTestingTargets>$(MSBuildThisFileDirectory)src\Mvc\Mvc.Testing\src\Microsoft.AspNetCore.Mvc.Testing.targets</MvcTestingTargets>
<_MvcTestingTasksAssembly>$(ArtifactsBinDir)\Microsoft.AspNetCore.Mvc.Testing.Tasks\$(Configuration)\netstandard2.0\Microsoft.AspNetCore.Mvc.Testing.Tasks.dll</_MvcTestingTasksAssembly>
<!-- IIS native projects can only be built on Windows for x86/x64/ARM64. -->
<BuildIisNativeProjects Condition=" '$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64' OR '$(TargetArchitecture)' == 'ARM64') ">true</BuildIisNativeProjects>
<UseIisNativeAssets Condition=" '$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64' OR '$(TargetArchitecture)' == 'ARM64') ">true</UseIisNativeAssets>
<!-- This property is shared by several projects to layout the AspNetCore.App targeting pack for installers -->
<TargetingPackLayoutRoot>$(ArtifactsObjDir)TargetingPack.Layout\$(Configuration)\</TargetingPackLayoutRoot>
<!-- This property is shared by several projects to layout the AspNetCore.App shared framework for installers -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
PrivateAssets="All"
GeneratePathProperty="true" />

<ProjectReference Condition=" '$(BuildIisNativeProjects)' == 'true' AND $(BuildNative) "
<ProjectReference Condition=" '$(UseIisNativeAssets)' == 'true' AND $(BuildNative) "
Include="$(RepoRoot)src\Servers\IIS\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj">
<SetPlatform>Platform=$(NativePlatform)</SetPlatform>
<!-- Custom attribute used to distinguish managed from native references. -->
Expand All @@ -148,7 +148,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<Targets>Build;GetTargetPath</Targets>
</ProjectReference>

<_ResolvedNativeProjectReferencePaths Condition=" '$(BuildIisNativeProjects)' == 'true' AND !$(BuildNative) "
<_ResolvedNativeProjectReferencePaths Condition=" '$(UseIisNativeAssets)' == 'true' AND !$(BuildNative) "
Include="$(ArtifactsBinDir)InProcessRequestHandler\$(NativePlatform)\$(Configuration)\aspnetcorev2_inprocess.dll">
<IsNativeImage>true</IsNativeImage>
</_ResolvedNativeProjectReferencePaths>
Expand Down Expand Up @@ -233,7 +233,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant

<Target Name="_WarnAboutUnbuiltNativeDependencies"
BeforeTargets="Build"
Condition=" '$(BuildIisNativeProjects)' == 'true' AND !$(BuildNative) AND
Condition=" '$(UseIisNativeAssets)' == 'true' AND !$(BuildNative) AND
!EXISTS('$(ArtifactsBinDir)InProcessRequestHandler\$(NativePlatform)\$(Configuration)\aspnetcorev2_inprocess.dll') ">
<Warning Text="This project has native dependencies which were not built. Without this, tests may not function correctly. Run `build.cmd -BuildNative -BuildManaged` to build both C# and C++." />
</Target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
</None>
</ItemGroup>

<ItemGroup Condition=" '$(BuildIisNativeProjects)' == 'true' ">
<ItemGroup Condition=" '$(UseIisNativeAssets)' == 'true' ">
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj" Platform="$(NativeVCPlatform)" />
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj" Platform="$(NativeVCPlatform)" />

<UpToDateCheckInput Include="$(AspNetCoreModuleV2OutOfProcessHandlerDll)" />
<UpToDateCheckInput Include="$(AspNetCoreModuleV2ShimDll)" />
</ItemGroup>

<Target Name="AddPackNativeComponents" AfterTargets="_CalculateInputsOutputsForPack" Condition="'$(BuildIisNativeProjects)' == 'true' AND '$(PackNativeAssets)' == 'true'">
<Target Name="AddPackNativeComponents" AfterTargets="_CalculateInputsOutputsForPack" Condition="'$(UseIisNativeAssets)' == 'true' AND '$(PackNativeAssets)' == 'true'">
<ItemGroup>
<!-- RunShimComponents is based on the current runtime (NativePlatform) which should be the same as TargetRuntimeIdentifier -->
<BuiltProjectOutputGroupOutput Include="%(RunShimComponents.DllLocation)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<Content Include="..\..\test\Common.FunctionalTests\Infrastructure\*.config" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

<ItemGroup Condition="'$(BuildIisNativeProjects)' == 'true'">
<ItemGroup Condition="'$(UseIisNativeAssets)' == 'true'">
<None Include="$(ArtifactsBinDir)InProcessRequestHandler\x64\$(Configuration)\aspnetcorev2_inprocess.dll" CopyToOutputDirectory="PreserveNewest" Visible="true" Link="%(FileName)%(Extension)" />
<None Include="$(ArtifactsBinDir)InProcessRequestHandler\x64\$(Configuration)\aspnetcorev2_inprocess.pdb" CopyToOutputDirectory="PreserveNewest" Visible="true" Link="%(FileName)%(Extension)" />
<None Include="$(ArtifactsBinDir)AspNetCoreModuleShim\x64\$(Configuration)\aspnetcorev2.dll" CopyToOutputDirectory="PreserveNewest" Visible="true" Link="%(FileName)%(Extension)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@

<Target Name="ValidateNativeComponentsBuilt" AfterTargets="Build" >
<Error Text="Required dll from ANCM has not been built. To build ANCM, you must use MSBuild.exe."
Condition="'$(BuildIisNativeProjects)' == 'true' AND !Exists('$(AspNetCoreModuleV2InProcessHandlerDll)')" />
Condition="'$(UseIisNativeAssets)' == 'true' AND !Exists('$(AspNetCoreModuleV2InProcessHandlerDll)')" />
</Target>

<ItemGroup Condition=" '$(BuildIisNativeProjects)' == 'true' ">
<ItemGroup Condition=" '$(UseIisNativeAssets)' == 'true' ">
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj" Platform="x64" />
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj" Platform="Win32" />
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\InProcessRequestHandler\InProcessRequestHandler.vcxproj" Platform="ARM64" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
<EmbeddedResource Include="Http.config" />
</ItemGroup>

<Target Name="ValidateNativeComponentsBuilt" AfterTargets="Build" Condition="'$(BuildIisNativeProjects)' == 'true' and '$(SkipTestBuild)' != 'true'">
<Target Name="ValidateNativeComponentsBuilt" AfterTargets="Build" Condition="'$(UseIisNativeAssets)' == 'true' and '$(SkipTestBuild)' != 'true'">
<Error Text="Required dll from ANCM has not been built. To build ANCM, you must use MSBuild.exe."
Condition="!Exists('$(AspNetCoreModuleV2ShimDll)') OR !Exists('$(AspNetCoreModuleV2OutOfProcessHandlerDll)')" />
</Target>

<ItemGroup Condition="'$(BuildIisNativeProjects)' == 'true' AND '$(TestGroupName)' != 'IISNewHandler.FunctionalTests'">
<ItemGroup Condition="'$(UseIisNativeAssets)' == 'true' AND '$(TestGroupName)' != 'IISNewHandler.FunctionalTests'">
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\AspNetCore\AspNetCore.vcxproj" Platform="x64"/>
<NativeProjectReference Include="$(MSBuildThisFileDirectory)..\..\AspNetCoreModuleV2\OutOfProcessRequestHandler\OutOfProcessRequestHandler.vcxproj" Platform="x64" />

Expand All @@ -44,13 +44,13 @@
<UpToDateCheckInput Include="$(AspNetCoreModuleV2OutOfProcessHandlerDll)" />
</ItemGroup>

<Target Name="AddRunNativeComponents" BeforeTargets="AssignTargetPaths" Condition="'$(BuildIisNativeProjects)' == 'true'">
<Target Name="AddRunNativeComponents" BeforeTargets="AssignTargetPaths" Condition="'$(UseIisNativeAssets)' == 'true'">
<ItemGroup>
<None Include="%(ShimComponents.DllLocation)" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" Condition="Exists('%(ShimComponents.DllLocation)')" Link="ANCM\%(ShimComponents.Platform)\%(ShimComponents.PackageSubPath)\%(ShimComponents.NativeAsset).dll" />
</ItemGroup>
</Target>

<Target Name="AddPackNativeComponents" BeforeTargets="_GetPackageFiles" Condition="'$(BuildIisNativeProjects)' == 'true'">
<Target Name="AddPackNativeComponents" BeforeTargets="_GetPackageFiles" Condition="'$(UseIisNativeAssets)' == 'true'">
<ItemGroup>
<Content Include="%(ShimComponents.DllLocation)" PackageCopyToOutput="true" PackagePath="contentFiles/any/any/%(ShimComponents.Platform)/%(ShimComponents.PackageSubPath)" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/Servers/IIS/build/assets.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!-- This file is autogenerated -->
<Project>
<PropertyGroup>
<BuildIisNativeProjects Condition="'$(SolutionName)' == 'IISIntegration'">true</BuildIisNativeProjects>
<PackNativeAssets Condition="'$(BuildIisNativeProjects)' == 'true'">true</PackNativeAssets>
<PackNativeAssets Condition="'$(BuildIisNativeProjects)' != 'true'">false</PackNativeAssets>
<UseIisNativeAssets Condition="'$(SolutionName)' == 'IISIntegration'">true</UseIisNativeAssets>
<PackNativeAssets Condition="'$(UseIisNativeAssets)' == 'true'">true</PackNativeAssets>
<PackNativeAssets Condition="'$(UseIisNativeAssets)' != 'true'">false</PackNativeAssets>
<NativePlatform Condition="'$(TargetArchitecture)' == 'AnyCPU'">x64</NativePlatform>
<NativePlatform Condition="'$(NativePlatform)' == ''">$(TargetArchitecture)</NativePlatform>
<NativeVCPlatform Condition="'$(NativePlatform)' == 'x86'">Win32</NativeVCPlatform>
Expand Down
4 changes: 2 additions & 2 deletions src/Servers/IIS/build/testsite.props
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
the end of processes using the GenerateBuildDependencyFile target.
-->
<Target Name="InjectRequestHandler"
Condition=" '$(InProcessTestSite)' == 'true' AND '$(BuildIisNativeProjects)' == 'true' AND '$(TargetFrameworkIdentifier)' != '.NETFramework'"
Condition=" '$(InProcessTestSite)' == 'true' AND '$(UseIisNativeAssets)' == 'true' AND '$(TargetFrameworkIdentifier)' != '.NETFramework'"
BeforeTargets="BuildDepsJson;CoreBuild"
DependsOnTargets="GenerateBuildDependencyFile;PrepareInjectionApp">
<Exec Command="$(InjectDepsApp) &quot;$(ProjectDepsFilePath)&quot; $(RuntimeIdentifier) " />
Expand All @@ -76,7 +76,7 @@
(GenerateSingleFileBundle also uses the intermediate .desp file but only in single-file publish cases ignored here.)
-->
<Target Name="InjectRequestHandlerOnPublish"
Condition=" '$(InProcessTestSite)' == 'true' AND '$(BuildIisNativeProjects)' == 'true' AND '$(TargetFrameworkIdentifier)' != '.NETFramework'"
Condition=" '$(InProcessTestSite)' == 'true' AND '$(UseIisNativeAssets)' == 'true' AND '$(TargetFrameworkIdentifier)' != '.NETFramework'"
BeforeTargets="Publish"
DependsOnTargets="GeneratePublishDependencyFile;CopyFilesToPublishDirectory;PrepareInjectionApp">
<Exec Command="$(InjectDepsApp) &quot;$(PublishDepsFilePath)&quot; $(RuntimeIdentifier) " />
Expand Down
2 changes: 1 addition & 1 deletion src/Servers/IIS/tools/GenerateNativeAssets.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ $content = @"
<!-- This file is autogenerated -->
<Project>
<PropertyGroup>
<PackNativeAssets Condition="'`$(BuildIisNativeProjects)' == 'true'">true</PackNativeAssets>
<PackNativeAssets Condition="'`$(UseIisNativeAssets)' == 'true'">true</PackNativeAssets>
<NativePlatform Condition="'`$(Platform)' == 'AnyCPU'">x64</NativePlatform>
<NativePlatform Condition="'`$(NativePlatform)' == ''">`$(Platform)</NativePlatform>
<NativeVCPlatform Condition="'`$(NativePlatform)' == 'x86'">Win32</NativeVCPlatform>
Expand Down