|
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.Runtime.csproj" |
| 29 | + Condition=" ! $(IsTargetingPackBuilding) " |
| 30 | + PrivateAssets="All" |
| 31 | + ReferenceOutputAssembly="false" |
| 32 | + SkipGetTargetFrameworkProperties="true" /> |
| 33 | + <ProjectReference Include="$(RepoRoot)src\Framework\App.Ref\src\Microsoft.AspNetCore.App.Ref.csproj" |
| 34 | + Condition=" $(IsTargetingPackBuilding) " |
| 35 | + PrivateAssets="All" |
| 36 | + ReferenceOutputAssembly="false" |
| 37 | + SkipGetTargetFrameworkProperties="true" /> |
31 | 38 |
|
32 | 39 | <Reference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" />
|
33 | 40 | <Compile Include="$(SharedSourceRoot)CommandLineUtils\**\*.cs" />
|
|
45 | 52 | <NuspecProperty Include="PackageThirdPartyNoticesFile=$(PackageThirdPartyNoticesFile)" />
|
46 | 53 | </ItemGroup>
|
47 | 54 |
|
48 |
| - |
| 55 | + <!-- |
| 56 | + As versioning changes, cannot compile against both the ASP.NET runtime / ref assemblies in the SDK e.g. a 5.0 SDK |
| 57 | + and Microsoft.AspNetCore.Components.WebAssembly.Server (which would be 6.0 in this example). Ensure we build using |
| 58 | + the targeting pack that's just been built. |
| 59 | + --> |
| 60 | + <Target Name="_UpdateSharedFrameworkAssemblies" |
| 61 | + AfterTargets="ResolveFrameworkReferences" |
| 62 | + BeforeTargets="ResolveTargetingPackAssets;_PrepareForReadyToRunCompilation;ResolveFrameworkReferencesDesignTime;_WarnAboutRedundantRef" |
| 63 | + DependsOnTargets="ResolveFrameworkReferences"> |
| 64 | + <PropertyGroup> |
| 65 | + <_PreviousTargetingPackVersion>@(ResolvedTargetingPack->WithMetadataValue('Identity', 'Microsoft.AspNetCore.App')->'%(NuGetPackageVersion)')</_PreviousTargetingPackVersion> |
| 66 | + <_PreviousTargetingPackPath>@(ResolvedTargetingPack->WithMetadataValue('Identity', 'Microsoft.AspNetCore.App')->'%(PackageDirectory)')</_PreviousTargetingPackPath> |
| 67 | + <_NewTargetingPackPath>$(_PreviousTargetingPackPath.Replace('$(_PreviousTargetingPackVersion)', '$(TargetingPackVersion)'))</_NewTargetingPackPath> |
| 68 | + </PropertyGroup> |
| 69 | + <ItemGroup> |
| 70 | + <ResolvedFrameworkReference Condition=" '%(Identity)' == 'Microsoft.AspNetCore.App' "> |
| 71 | + <TargetingPackVersion>$(TargetingPackVersion)</TargetingPackVersion> |
| 72 | + <TargetingPackPath>$(_NewTargetingPackPath)</TargetingPackPath> |
| 73 | + </ResolvedFrameworkReference> |
| 74 | + <ResolvedTargetingPack Condition=" '%(Identity)' == 'Microsoft.AspNetCore.App' "> |
| 75 | + <NuGetPackageVersion>$(TargetingPackVersion)</NuGetPackageVersion> |
| 76 | + <PackageDirectory>$(_NewTargetingPackPath)</PackageDirectory> |
| 77 | + <Path>$(_NewTargetingPackPath)</Path> |
| 78 | + </ResolvedTargetingPack> |
| 79 | + </ItemGroup> |
| 80 | + </Target> |
49 | 81 | </Project>
|
0 commit comments