Skip to content

Commit e27f912

Browse files
committed
Explicitly map @(Reference) to @(PackageReference) for Microsoft.Internal.Extensions.Refs
1 parent f1fbb2d commit e27f912

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

eng/targets/ResolveReferences.targets

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,24 @@
210210
Text="Could not resolve this reference. Could not locate the package or project for "%(Reference.Identity)". Did you update baselines and dependencies lists? See docs/ReferenceResolution.md for more details." />
211211
</Target>
212212

213+
<PropertyGroup>
214+
<_CompileTfmUsingReferenceAssemblies>false</_CompileTfmUsingReferenceAssemblies>
215+
<_CompileTfmUsingReferenceAssemblies
216+
Condition=" '$(CompileUsingReferenceAssemblies)' != false AND '$(TargetFramework)' == '$(DefaultNetCoreTargetFramework)' ">true</_CompileTfmUsingReferenceAssemblies>
217+
</PropertyGroup>
218+
<!--
219+
If we have a ref/ assembly from Extensions for a package, use that when compiling. The build-only reference to
220+
Microsoft.Internal.Extensions.Refs ensures package is installed and $(MicrosoftInternalExtensionsRefsPath) is set.
221+
-->
222+
<ItemGroup
223+
Condition=" $(_CompileTfmUsingReferenceAssemblies) OR ('$(IsTargetingPackBuilding)' != 'false' AND '$(MSBuildProjectName)' == 'Microsoft.AspNetCore.App.Ref') ">
224+
<PackageReference Include="Microsoft.Internal.Extensions.Refs"
225+
Version="$(MicrosoftInternalExtensionsRefsPackageVersion)"
226+
IsImplicitlyDefined="true"
227+
IncludeAssets="Build"
228+
PrivateAssets="All" />
229+
</ItemGroup>
230+
213231
<!-- These targets are used to generate the map of assembly name to project files. See also the /t:GenerateProjectList target in build/repo.targets. -->
214232
<Target Name="GetReferencesProvided" Returns="@(ProvidesReference)">
215233
<ItemGroup>

src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ This package is an internal implementation of the .NET Core SDK and is not meant
5959
<ItemGroup>
6060
<!-- Note: do not add _TransitiveExternalAspNetCoreAppReference to this list. This is intentionally not listed as a direct package reference. -->
6161
<Reference Include="@(AspNetCoreAppReference);@(AspNetCoreAppReferenceAndPackage);@(ExternalAspNetCoreAppReference)" />
62-
<Reference Include="Microsoft.Internal.Extensions.Refs" Version="$(MicrosoftInternalExtensionsRefsPackageVersion)" IncludeAssets="Build" />
6362
<!-- Enforce build order. Targeting pack needs to bundle information about the runtime. -->
6463
<ProjectReference Include="..\src\Microsoft.AspNetCore.App.Runtime.csproj">
6564
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>

0 commit comments

Comments
 (0)