Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error thrown for application after installing latest package to coreapp3.1 project #1033

Closed
cortex-ab opened this issue May 11, 2022 · 1 comment

Comments

@cortex-ab
Copy link

Bug description

We have a web application that we have just installed the latest version of Microsoft.VisualStudio.Threading onto (17.2.32).
After deploying it to our test environments, an error was thrown:
The framework 'Microsoft.WindowsDesktop.App', version '3.1.0' was not found.
It seems there is now a requirement on that where there wasn't before.

Repro steps

I created an empty project, csproj:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>

</Project>

after building it, the runtimeconfig.json file produced looks like this:

{
  "runtimeOptions": {
    "tfm": "netcoreapp3.1",
    "framework": {
      "name": "Microsoft.AspNetCore.App",
      "version": "3.1.0"
    },
    "configProperties": {
      "System.GC.Server": true,
      "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
    }
  }
}

After installing the package:
csproj:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.VisualStudio.Threading" Version="17.2.32" />
  </ItemGroup>

</Project>

runtimeconfig.json:

{
  "runtimeOptions": {
    "tfm": "netcoreapp3.1",
    "frameworks": [
      {
        "name": "Microsoft.WindowsDesktop.App",
        "version": "3.1.0"
      },
      {
        "name": "Microsoft.AspNetCore.App",
        "version": "3.1.0"
      }
    ],
    "configProperties": {
      "System.GC.Server": true,
      "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
    }
  }
}

I'm assuming this was not indended? previous version 17.1.46 does not have the same issue.

I was trying to see what had that dependency and found that

          "PresentationCore": "4.0.0.0",
          "PresentationFramework.Aero": "4.0.0.0",
          "PresentationFramework.Aero2": "4.0.0.0",
          "PresentationFramework.AeroLite": "4.0.0.0",
          "PresentationFramework.Classic": "4.0.0.0",
          "PresentationFramework": "4.0.0.0",
          "PresentationFramework.Luna": "4.0.0.0",
          "PresentationFramework.Royale": "4.0.0.0",
          "PresentationUI": "4.0.0.0",
          "ReachFramework": "4.0.0.0",

was pulled in...but not sure what has referenced them either.

For now I have downgraded the package back to 17.1.46 and everything is working

@AArnott
Copy link
Member

AArnott commented May 11, 2022

This is in fact by design, because for netcoreapp3.1 we added the DispatcherSynchronizationContext-related APIs that previously were only found on net472.
You can avoid the WindowsDesktop runtime requirement by targeting net5.0+, which added the ability for us to split net5.0 from net5.0-windows targeting so that net5.0 consumers could avoid the WindowsDesktop runtime requirement.

@AArnott AArnott closed this as not planned Won't fix, can't repro, duplicate, stale May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants