Sdk: .NET Core 3.1 project depends on Windows Desktop

Created on 1 May 2020  路  3Comments  路  Source: dotnet/sdk

I tried to run the PowerShell tool on Windows ARM64. I wasn't expecting to see the dependence on the Windows Desktop framework. I ran a 3.0 app to demonstrate that roll-forward works.

This is what I saw:

C:\git\testapps\versioninfo>set DOTNET_ROLL_FORWARD=LatestMajor

C:\git\testapps\versioninfo>bin\Debug\netcoreapp3.0\versioninfo.exe
**.NET Core info**
Version: 5.0.0
FrameworkDescription: .NET 5.0.0-preview.4.20227.9
CoreCLR Build: 5.0.0-preview.4.20227.9
CoreCLR Hash: 6d1f7e01d3429054ec3dcb7c75b3450b9fe1429e
CoreFX Build: 5.0.0-preview.4.20227.9
CoreFX Hash: 6d1f7e01d3429054ec3dcb7c75b3450b9fe1429e

**Environment info**
OSVersion: Microsoft Windows NT 10.0.16299.0
OSDescription: Microsoft Windows 10.0.16299
OSArchitecture: Arm64
ProcessorCount: 8


C:\git\testapps\versioninfo>pwsh
It was not possible to find any compatible framework version
The framework 'Microsoft.WindowsDesktop.App', version '3.1.0' was not found.
  - No frameworks were found.

You can resolve the problem by installing the specified framework and/or SDK.

The specified framework can be found at:
  - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.WindowsDesktop.App&framework_version=3.1.0&arch=arm64&rid=win10-arm64

Most helpful comment

Oh, man! I did try to do my homework on this. I was looking at various config files in the PowerShell NuGet package, and someone missed the most important one. I agree, this is the correct behavior. Thanks!

All 3 comments

Is this not an explicit dependency added by powershell to WindowsDesktop? What does the runtimeconfig.json look like?

https://github.com/PowerShell/PowerShell/blob/6d1d62f2f83b526997d23e0606be9d5708246e9f/src/powershell-win-core/powershell-win-core.csproj#L17-L30

pwsh.runtimeconfig.json

{
  "runtimeOptions": {
    "tfm": "netcoreapp3.1",
    "includedFrameworks": [
      {
        "name": "Microsoft.NETCore.App",
        "version": "3.1.2"
      },
      {
        "name": "Microsoft.WindowsDesktop.App",
        "version": "3.1.2"
      }
    ],
    "rollForwardOnNoCandidateFx": 2,
    "configProperties": {
      "System.Runtime.TieredCompilation": true,
      "System.Runtime.TieredCompilation.QuickJit": true,
      "System.Runtime.TieredCompilation.QuickJitForLoops": true
    }
  }
}

Oh, man! I did try to do my homework on this. I was looking at various config files in the PowerShell NuGet package, and someone missed the most important one. I agree, this is the correct behavior. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

noelitoa picture noelitoa  路  3Comments

dsplaisted picture dsplaisted  路  3Comments

aguacongas picture aguacongas  路  3Comments

gkhanna79 picture gkhanna79  路  3Comments

dasMulli picture dasMulli  路  3Comments