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

8.0.1 hosting bundle no longer allows net8.0-windows #37892

Closed
SimonCropp opened this issue Jan 10, 2024 · 18 comments
Closed

8.0.1 hosting bundle no longer allows net8.0-windows #37892

SimonCropp opened this issue Jan 10, 2024 · 18 comments
Labels
area-Host untriaged Request triage from a team member

Comments

@SimonCropp
Copy link
Contributor

SimonCropp commented Jan 10, 2024

Our projects target net8.0-windows

<TargetFramework>net8.0-windows</TargetFramework>

After updating to sdk 8.0.101 and rebuilding our apps no longer run:

You must install or update .NET to run this application. 
App: C:\Octopus\Applications\Dev\Notifications.Deploy\2.0.63603_2\installer\Notifications.Install.exe 
Architecture: x64 
Framework: 'Microsoft.WindowsDesktop.App', version '8.0.0' (x64) 
.NET location: C:\Program Files\dotnet\ 
No frameworks were found. 
Learn more: 
https://aka.ms/dotnet/app-launch-failed 
To install missing framework, download: 
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.WindowsDesktop.App&framework_version=8.0.0&arch=x64&rid=win-x64&os=win10 

note that
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.WindowsDesktop.App&framework_version=8.0.0&arch=x64&rid=win-x64&os=win10
redirects to
https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-8.0.1-windows-x64-installer?cid=getdotnetcore

When building from 8.0.100 sdk we used to be able to run with only the hosting bundle installed
https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-aspnetcore-8.0.1-windows-hosting-bundle-installer
ie no Desktop Runtime required

if i change to changing net8

<TargetFramework>net8.0</TargetFramework>

and our apps start running again

dotnet -- info

C:\Users\scropp>dotnet --info

Host:
  Version:      8.0.1
  Architecture: x64
  Commit:       bf5e279d92
  RID:          win-x64

.NET SDKs installed:
  No SDKs were found.

.NET runtimes installed:
  Microsoft.AspNetCore.App 7.0.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 7.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

runtimeconfig.json

and when i look the same runtimeconfig.json between the sdks the 8.0.1 has indeed added Microsoft.WindowsDesktop.App

from 8.0.100 sdk

{
  "runtimeOptions": {
    "tfm": "net8.0",
    "rollForward": "LatestMinor",
    "frameworks": [
      {
        "name": "Microsoft.NETCore.App",
        "version": "8.0.0"
      },
      {
        "name": "Microsoft.AspNetCore.App",
        "version": "8.0.0"
      }
    ]
  }
}

from 8.0.101 sdk

{
  "runtimeOptions": {
    "tfm": "net8.0",
    "rollForward": "LatestMinor",
    "frameworks": [
      {
        "name": "Microsoft.NETCore.App",
        "version": "8.0.0"
      },
      {
        "name": "Microsoft.WindowsDesktop.App",
        "version": "8.0.0"
      },
      {
        "name": "Microsoft.AspNetCore.App",
        "version": "8.0.0"
      }
    ]
  }
}

Questions

  • So was this an intentional change?
  • Should we also be deploying Microsoft.WindowsDesktop.App to run our apps?
@ghost ghost added the untriaged Request triage from a team member label Jan 10, 2024
@SimonCropp
Copy link
Contributor Author

perhaps this should be a discussion?? since i dont really know if it is a bug, or i am just "holding it wrong"

@SimonCropp
Copy link
Contributor Author

working on a repro. but i need to find the correct combo of moving pieces

@ghost
Copy link

ghost commented Jan 10, 2024

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

Issue Details

Our projects target net8.0-windows

<TargetFramework>net8.0-windows</TargetFramework>

After updating to sdk 8.0.101 and rebuilding our apps no longer run:

You must install or update .NET to run this application. 
App: C:\Octopus\Applications\Dev\Notifications.Deploy\2.0.63603_2\installer\Notifications.Install.exe 
Architecture: x64 
Framework: 'Microsoft.WindowsDesktop.App', version '8.0.0' (x64) 
.NET location: C:\Program Files\dotnet\ 
No frameworks were found. 
Learn more: 
https://aka.ms/dotnet/app-launch-failed 
To install missing framework, download: 
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.WindowsDesktop.App&framework_version=8.0.0&arch=x64&rid=win-x64&os=win10 

note that
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.WindowsDesktop.App&framework_version=8.0.0&arch=x64&rid=win-x64&os=win10
redirects to
https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-8.0.1-windows-x64-installer?cid=getdotnetcore

When building from 8.0.100 sdk we used to be able to run with only the hosting bundle installed
https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-aspnetcore-8.0.1-windows-hosting-bundle-installer
ie no Desktop Runtime required

if i change to changing net8

<TargetFramework>net8.0</TargetFramework>

and our apps start running again

dotnet -- info

C:\Users\scropp>dotnet --info

Host:
  Version:      8.0.1
  Architecture: x64
  Commit:       bf5e279d92
  RID:          win-x64

.NET SDKs installed:
  No SDKs were found.

.NET runtimes installed:
  Microsoft.AspNetCore.App 7.0.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 7.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

runtimeconfig.json

and when i look the same runtimeconfig.json between the sdks the 8.0.1 has indeed added Microsoft.WindowsDesktop.App

from 8.0.100 sdk

{
  "runtimeOptions": {
    "tfm": "net8.0",
    "rollForward": "LatestMinor",
    "frameworks": [
      {
        "name": "Microsoft.NETCore.App",
        "version": "8.0.0"
      },
      {
        "name": "Microsoft.AspNetCore.App",
        "version": "8.0.0"
      }
    ]
  }
}

from 8.0.101 sdk

{
  "runtimeOptions": {
    "tfm": "net8.0",
    "rollForward": "LatestMinor",
    "frameworks": [
      {
        "name": "Microsoft.NETCore.App",
        "version": "8.0.0"
      },
      {
        "name": "Microsoft.WindowsDesktop.App",
        "version": "8.0.0"
      },
      {
        "name": "Microsoft.AspNetCore.App",
        "version": "8.0.0"
      }
    ]
  }
}

Questions

  • So was this an intentional change?
  • Should we also be deploying Microsoft.WindowsDesktop.App to run our apps?
Author: SimonCropp
Assignees: -
Labels:

area-Host, untriaged

Milestone: -

@vitek-karas
Copy link
Member

Going to move this to dotnet/sdk since that's where the logic to generate the .runtimeconfig.json exists.

@vitek-karas vitek-karas transferred this issue from dotnet/runtime Jan 10, 2024
@baronfel
Copy link
Member

baronfel commented Jan 10, 2024

@SimonCropp what's a good repro for this behavior? Is a new console app targeting net8.0-windows on 8.0.101 SDK all that's required to reproduce? I'm trying to get a binlog so I can look at how/why the set of RuntimeFrameworks passed to the GenearteRuntimeConfigurationFiles Task changes across versions. I haven't been able to reproduce yet with just a console app.

@campersau
Copy link
Contributor

I think I found a minimal reproduction, it looks like it is because of Microsoft.Data.SqlClient.
Create a new console app with this csproj:

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

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0-windows</TargetFramework>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.4" />
  </ItemGroup>

</Project>

This will include the Microsoft.WindowsDesktop.App reference:

{
  "runtimeOptions": {
    "tfm": "net8.0",
    "frameworks": [
      {
        "name": "Microsoft.NETCore.App",
        "version": "8.0.0"
      },
      {
        "name": "Microsoft.WindowsDesktop.App",
        "version": "8.0.0"
      }
    ],
    "configProperties": {
      "System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
      "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
    }
  }
}

Do a dotnet publish then run it on a machine which only has the runtime or aspnet core hosting bundle installed.

@campersau
Copy link
Contributor

campersau commented Jan 10, 2024

Updating Microsoft.Data.SqlClient from 5.1.3 to 5.1.4 adds these dependencies and it looks like these are the actual issue here at least for me (e.g. WebView2):

image

image

After I downgrade to 5.1.3 it works for me like before.

@baronfel
Copy link
Member

baronfel commented Jan 10, 2024

@campersau I'm having a hard time reproducing. For this project:

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

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0-windows</TargetFramework>
    <RootNamespace>sdk_37892</RootNamespace>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.4" />
  </ItemGroup>
</Project>

when I publish I get the following runtimeconfig.json:

{
  "runtimeOptions": {
    "tfm": "net8.0",
    "framework": {
      "name": "Microsoft.NETCore.App",
      "version": "8.0.0"
    },
    "configProperties": {
      "System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
      "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
    }
  }
}

without the WindowsDesktop framework. I'll try again with the 5.1.3 to 5.1.4 transition and see if I can get it to trigger.

EDIT: Nevermind, I did get it to trigger. The offending dependency is Microsoft.Identity.Client/4.56.0 per the project.assets.json:

      "Microsoft.Identity.Client/4.56.0": {
        "type": "package",
        "dependencies": {
          "Microsoft.Identity.Client.NativeInterop": "0.13.8",
          "Microsoft.IdentityModel.Abstractions": "6.22.0",
          "Microsoft.Web.WebView2": "1.0.864.35"
        },
        "compile": {
          "lib/net6.0-windows7.0/Microsoft.Identity.Client.dll": {
            "related": ".xml"
          }
        },
        "runtime": {
          "lib/net6.0-windows7.0/Microsoft.Identity.Client.dll": {
            "related": ".xml"
          }
        },
        "frameworkReferences": [
          "Microsoft.WindowsDesktop.App.WindowsForms"
        ]
      },

@baronfel
Copy link
Member

We need to reach out to the IdentityClient folks to see if this is an absolute requirement. Their repository is
https://github.com/AzureAD/microsoft-authentication-library-for-dotnet.

@campersau
Copy link
Contributor

Looks like there is already an issue for it: AzureAD/microsoft-authentication-library-for-dotnet#4468

@baronfel
Copy link
Member

In the interim, I think I'm curious why the behavior seemingly changed between 8.0.100 and 8.0.101 - @SimonCropp are you sure that there were no other package version changes as part of your update?

@SimonCropp
Copy link
Contributor Author

@baronfel sorry you are correct. we also update the sql nuget when doing the sdk change. so i have my wires crossed

do u want to close this one? or rename it?

@baronfel
Copy link
Member

I think we should close it for now - though we on the SDK team will try to reach out to the identity folks to determine a way to use the library that doesn't silently introduce new runtimes.

@SimonCropp
Copy link
Contributor Author

ok will close.

but is this effectively the cause of the bug dotnet/SqlClient#1108 (comment) ?

@baronfel
Copy link
Member

That seems correct, looks like the team has a POC for removing some of the dependencies that may fix the issue?

@SimonCropp
Copy link
Contributor Author

@baronfel is there a url for that discussion?

@rclabo
Copy link

rclabo commented Apr 17, 2024

This bit me and it's a pain. I can't believe our website deployment that uses SqlServer is down because Microsoft.Data.SqlClient now requires a desktop framework install. What?

This title seems accurate and unthinkable at the same time. "8.0.1 hosting bundle no longer allows net8.0-windows" It's hard to understand how such a bug could be released. That it was released clearly shows the limits of unit testing. And the bug still is not fixed after being identified 3.5 months ago. (sigh)

Is this the best place to see the current status? AzureAD/microsoft-authentication-library-for-dotnet#4468 Are their other places one can get a status update?

@SimonCropp
Copy link
Contributor Author

@rclabo here is the underlying issue and best place to discuss dotnet/SqlClient#1108

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Host untriaged Request triage from a team member
Projects
Archived in project
Development

No branches or pull requests

6 participants