Skip to content

Commit 77db438

Browse files
authored
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 77db438

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

eng/WpfArcadeSdk/tools/RuntimeFrameworkReference.targets

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
<Project>
2+
<PropertyGroup>
3+
<EnableManagedPackageReferenceSupport>true</EnableManagedPackageReferenceSupport>
4+
</PropertyGroup>
5+
26
<!-- 
37
Explicitly import Microsoft.NETCore.Platforms to prevent using the one from the SDK, which
48
usually lags behind the version that WPF gets from CoreFx packages
@@ -15,9 +19,7 @@
1519
<FrameworkReference Update="Microsoft.NETCore.App"
1620
Condition="'$(MicrosoftNETCoreAppRefVersion)'!=''
1721
And '$(NoTargets)'!='true'
18-
And '$(TargetFrameworkIdentifier)' == '.NETCoreApp'
19-
And $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '3.0'))
20-
And '$(MSBuildProjectExtension)'!='.vcxproj'">
22+
And '$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
2123
<TargetingPackVersion>$(MicrosoftNETCoreAppRefVersion)</TargetingPackVersion>
2224
</FrameworkReference>
2325

@@ -31,8 +33,6 @@
3133
<PropertyGroup>
3234
<RuntimeFrameworkVersion Condition="'$(MicrosoftNETCoreAppRuntimewinx64Version)'!='' And
3335
'$(NoTargets)'!='true' And
34-
'$(TargetFrameworkIdentifier)' == '.NETCoreApp' And
35-
$([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '3.0')) And
36-
'$(MSBuildProjectExtension)'!='.vcxproj'">$(MicrosoftNETCoreAppRuntimewinx64Version)</RuntimeFrameworkVersion>
36+
'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">$(MicrosoftNETCoreAppRuntimewinx64Version)</RuntimeFrameworkVersion>
3737
</PropertyGroup>
3838
</Project>

0 commit comments

Comments
 (0)