|
13 | 13 | <IsProjectReferenceProvider>false</IsProjectReferenceProvider>
|
14 | 14 |
|
15 | 15 | <!--
|
16 |
| - This project compiles against Microsoft.AspNetCore.App from the SDK. |
17 |
| - This ensures that it's packaging output is correct and does not include local artifacts. |
| 16 | + Act as if this project will compile against the Microsoft.AspNetCore.App from the SDK. This ensures that its |
| 17 | + packaging output is correct and does not include local artifacts. But, see last-minute fixup in the |
| 18 | + _UpdateSharedFrameworkAssemblies.target. |
18 | 19 | -->
|
19 | 20 | <UseAspNetCoreSharedRuntime>true</UseAspNetCoreSharedRuntime>
|
20 | 21 | <DoNotApplyWorkaroundsToMicrosoftAspNetCoreApp>true</DoNotApplyWorkaroundsToMicrosoftAspNetCoreApp>
|
|
23 | 24 | <ItemGroup>
|
24 | 25 | <FrameworkReference Include="Microsoft.AspNetCore.App" />
|
25 | 26 |
|
26 |
| - <ProjectReference |
27 |
| - Include="$(RepoRoot)src\Framework\App.Runtime\src\Microsoft.AspNetCore.App.Runtime.csproj" |
28 |
| - PrivateAssets="All" |
29 |
| - ReferenceOutputAssembly="false" |
30 |
| - SkipGetTargetFrameworkProperties="true" /> |
| 27 | + <!-- Ensure "just been built" is correct. --> |
| 28 | + <ProjectReference Include="$(RepoRoot)src\Framework\App.Ref\src\Microsoft.AspNetCore.App.Ref.csproj" |
| 29 | + Condition=" $(IsTargetingPackBuilding) " |
| 30 | + PrivateAssets="All" |
| 31 | + ReferenceOutputAssembly="false" |
| 32 | + SkipGetTargetFrameworkProperties="true" /> |
31 | 33 |
|
32 | 34 | <Reference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" />
|
33 | 35 | <Compile Include="$(SharedSourceRoot)CommandLineUtils\**\*.cs" />
|
|
45 | 47 | <NuspecProperty Include="PackageThirdPartyNoticesFile=$(PackageThirdPartyNoticesFile)" />
|
46 | 48 | </ItemGroup>
|
47 | 49 |
|
48 |
| - |
| 50 | + <!-- |
| 51 | + As versioning changes, cannot compile against both the ASP.NET runtime / ref assemblies in the SDK e.g. a 5.0 SDK |
| 52 | + and Microsoft.AspNetCore.Components.WebAssembly.Server (which would be 6.0 in this example). Ensure we build using |
| 53 | + the targeting pack that's just been built. |
| 54 | + --> |
| 55 | + <Target Name="_UpdateSharedFrameworkAssemblies" |
| 56 | + AfterTargets="ResolveFrameworkReferences" |
| 57 | + BeforeTargets="ResolveTargetingPackAssets;_PrepareForReadyToRunCompilation;ResolveFrameworkReferencesDesignTime;_WarnAboutRedundantRef" |
| 58 | + Condition=" $(IsTargetingPackBuilding) " |
| 59 | + DependsOnTargets="ResolveFrameworkReferences"> |
| 60 | + <PropertyGroup> |
| 61 | + <_PreviousTargetingPackVersion>@(ResolvedTargetingPack->WithMetadataValue('Identity', 'Microsoft.AspNetCore.App')->'%(NuGetPackageVersion)')</_PreviousTargetingPackVersion> |
| 62 | + <_PreviousTargetingPackPath>@(ResolvedTargetingPack->WithMetadataValue('Identity', 'Microsoft.AspNetCore.App')->'%(PackageDirectory)')</_PreviousTargetingPackPath> |
| 63 | + <_NewTargetingPackPath>$(_PreviousTargetingPackPath.Replace('$(_PreviousTargetingPackVersion)', '$(TargetingPackVersion)'))</_NewTargetingPackPath> |
| 64 | + </PropertyGroup> |
| 65 | + <ItemGroup Condition=" EXISTS('$(_NewTargetingPackPath)') "> |
| 66 | + <ResolvedFrameworkReference Condition=" '%(Identity)' == 'Microsoft.AspNetCore.App' "> |
| 67 | + <TargetingPackVersion>$(TargetingPackVersion)</TargetingPackVersion> |
| 68 | + <TargetingPackPath>$(_NewTargetingPackPath)</TargetingPackPath> |
| 69 | + </ResolvedFrameworkReference> |
| 70 | + <ResolvedTargetingPack Condition=" '%(Identity)' == 'Microsoft.AspNetCore.App' "> |
| 71 | + <NuGetPackageVersion>$(TargetingPackVersion)</NuGetPackageVersion> |
| 72 | + <PackageDirectory>$(_NewTargetingPackPath)</PackageDirectory> |
| 73 | + <Path>$(_NewTargetingPackPath)</Path> |
| 74 | + </ResolvedTargetingPack> |
| 75 | + </ItemGroup> |
| 76 | + </Target> |
49 | 77 | </Project>
|
0 commit comments