Skip to content

Commit 038bc30

Browse files
committed
Use live runtime references for vcxproj
Fixes #9490 Unblocks dotnet/sdk#43015 When building wpf inside the VMR, a 10.0.100 SDK is used. WPF currently still targets net9.0. As WPF directly depends on runtime, it already uses 10.0.0-alpha versions of the targeting and runtime packs for managed projects. Enable this for vcxprojs as well so that the host packages can also be restored from the flowing runtime dependency. Fixes errors like these: > The Apphost pack is not installed and NuGet package restore is not supported. Upgrade Visual Studio, remove global.json if it specifies a certain SDK version, and uninstall the newer SDK. For more options visit https://aka.ms/targeting-apphost-pack-missing Pack Type:Apphost, Pack directory: D:\a\_work\1\vmr\.dotnet\packs\Microsoft.NETCore.App.Host.win-x64, targetframework: net9.0, Pack PackageId: Microsoft.NETCore.App.Host.win-x64, Pack Package Version: 9.0.0-rc.2.24473.5
1 parent 68baa81 commit 038bc30

File tree

4 files changed

+5
-19
lines changed

4 files changed

+5
-19
lines changed

eng/WpfArcadeSdk/tools/RuntimeFrameworkReference.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<!-- workaround for package downgrade in Microsoft.NetCore.Platforms -->
33
<PropertyGroup>
44
<DisableImplicitNETCorePlatformsReference>true</DisableImplicitNETCorePlatformsReference>
5+
<EnableManagedPackageReferenceSupport>true</EnableManagedPackageReferenceSupport>
56
</PropertyGroup>
67

78
</Project>

eng/WpfArcadeSdk/tools/RuntimeFrameworkReference.targets

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@
1313
Condition="'$(ManagedCxx)'=='true'"/>
1414

1515
<FrameworkReference Update="Microsoft.NETCore.App"
16-
Condition="'$(MicrosoftNETCoreAppRefVersion)'!=''
17-
And '$(NoTargets)'!='true'
18-
And '$(TargetFrameworkIdentifier)' == '.NETCoreApp'
19-
And $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '3.0'))
20-
And '$(MSBuildProjectExtension)'!='.vcxproj'">
21-
<TargetingPackVersion>$(MicrosoftNETCoreAppRefVersion)</TargetingPackVersion>
16+
Condition="'$(NoTargets)'!='true'
17+
And '$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
18+
<TargetingPackVersion Condition="'$(MicrosoftNETCoreAppRefVersion)' != ''">$(MicrosoftNETCoreAppRefVersion)</TargetingPackVersion>
19+
<RuntimeFrameworkVersion Condition="'$(MicrosoftNETCoreAppRuntimewinx64Version)' != ''">$(MicrosoftNETCoreAppRuntimewinx64Version)</RuntimeFrameworkVersion>
2220
</FrameworkReference>
2321

2422
<!--
@@ -27,12 +25,4 @@
2725
-->
2826
<KnownFrameworkReference Remove="Microsoft.AspNetCore.App" />
2927
</ItemGroup>
30-
31-
<PropertyGroup>
32-
<RuntimeFrameworkVersion Condition="'$(MicrosoftNETCoreAppRuntimewinx64Version)'!='' And
33-
'$(NoTargets)'!='true' And
34-
'$(TargetFrameworkIdentifier)' == '.NETCoreApp' And
35-
$([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '3.0')) And
36-
'$(MSBuildProjectExtension)'!='.vcxproj'">$(MicrosoftNETCoreAppRuntimewinx64Version)</RuntimeFrameworkVersion>
37-
</PropertyGroup>
3828
</Project>

src/Microsoft.DotNet.Wpf/src/DirectWriteForwarder/DirectWriteForwarder.vcxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
</ItemGroup>
2929
<PropertyGroup>
3030
<UseDestinationLibFolder>true</UseDestinationLibFolder>
31-
<TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
32-
<RestoreProjectStyle>Unknown</RestoreProjectStyle>
3331
<!--
3432
Opting out of this to ensure _WindowsBaseReference is used as
3533
OutputItemsType in the project reference later.

src/Microsoft.DotNet.Wpf/src/System.Printing/System.Printing.vcxproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
</ItemGroup>
2929
<PropertyGroup>
3030
<UseDestinationLibFolder>true</UseDestinationLibFolder>
31-
<TargetFrameworkIdentifier>.NETCoreApp</TargetFrameworkIdentifier>
32-
<TargetFrameworkVersion>v6.0</TargetFrameworkVersion>
33-
<RestoreProjectStyle>Unknown</RestoreProjectStyle>
3431
<!--
3532
Opting out of this to ensure _defineReference is used as
3633
OutputItemsType in the project references later.

0 commit comments

Comments
 (0)