You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
App after upgrade 5.1.2 -> 5.1.4 starts require .NET Desktop Runtime instead of .NET Runtime #2309
After upgrade some dependencies in our app (ASP NET MVC & console projects under .Net7) it suddenly starts require Desktop Runtime instead of console one which was enough previously.
Downgrading only SqlClient back to 5.1.2 helps it works again without Desktop runtime.
With our app it is reproducible with only changing 1 symbol 2->4 in csproj.
Unfortunately i do not manage to reproduce this with simple console app with only 1 despondency to SqlClient.
Any idea what it can be be?
Reacted by cremor
Reacted by Shashank Kedia, Gaurav Katoch, Jochen Jonckheere and Justin Toth
I suspect it was the bump in the Azure.Identity dependency version in 5.1.4 to address the Azure.Identity vulnerability. Does the same thing result from only bumping to MDS 5.1.3? The only thing that changed from 5.1.3 to 5.1.4 was that dependency version. I don't think there will be anything we can do about it if Azure.Identity is bringing in the Desktop Runtime requirement.
Have tested with 5.1.3 - it is OK no Desktop needed.
So you are right.
It will be surprise for many projects, as it happens for us.
In any case having such direct dependency in so low level lib looks not very good.
Seems such services better manage with DI. Not all projects using MSSQL run in Azure.
Just having this dependency cause loading additional 700K of dlls with unneeded functionality.
Reacted by Shashank Kedia, Justin Toth and Avinesh Singh
This broke upgraded applications in our environment as well. We containerize ASP.NET Core workloads and run them with the dotnet/aspnet:8.0-nanoserver-ltsc2022 base layer; they work fine until MDS 5.1.3. When we upgrade to MDS 5.1.4, they fail to start up (failure log below). FWIW, we don't use Azure Identity services for these applications either.
You must install or update .NET to run this application.
App: C:\app\<Redacted>.dll
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
We use net7.0-windows because of
300+ Warnings
CA1416 This call site is reachable on all platforms. 'XXXX' is only supported on: 'windows'.
And we are not ready to clean this out
@AlexanderKot this is by design when using WAM (Web Account Manager).
When targeting net-windows WAM is included by default.
For migration purposes, and if you have a .NET 6, .NET Core, or a .NET Standard application that needs to use both WAM and the embedded browser, you will also need to use the Microsoft.Identity.Client.Desktop package. Once added, developers can use WithWindowsDesktopFeatures when setting up their public client application.
If your application targets UWP or net-windows (version-dependent Target Framework Moniker for Windows), WAM is included in the MSAL.NET package.
Thank you
we can use many workarounds including proposed by you.
But we are not unique with this problem, and before 5.1.4 it was no such dependency.
Ideal solution could be removing direct dependency to Azure libs from DB access lib, and embed it using DI whenever it is really needed. Lets imagine that instead Azure we need AWS infrastructure ...
I understood that chances that this will happens are minimal. :(
@AlexanderKot, I guess this is something new which was added to the latest release of Microsoft.Identity.Client. I can happily transfer the issue to that repository or you can open an issue with them. As SqlClient driver we do not have any control over that behavior.
@ErikEJ we're targeting net8-windows in our affected projects. That's intentional and required: we depend on certain libraries that use Windows-specific APIs, and it's not something that we can trivially eliminate (and we therefore containerize such applications on Windows hosts with the dotnet/aspnet:8.0-nanoserver-ltsc2022 base layer). And to clarify (again), we do not require any Azure Identity services; the stuff we're doing is all on-premise.
What I can see is from the dependency graph (made it myself):
But the main problem is that Azure.Identity 1.7.0 is marked as Vulnerable as well...
And if we manually set Azure.Identity to the last non-vulnerable one (1.10.2), it needs:
Microsoft.Identity.Client (>= 4.54.1)
Which by itself - I think - requires .Net Desktop Runtime like previously mentioned.
So for most of us there is either a choice of using the MDS 5.1.3 with Azure.Identity (1.7.0) that is marked vulnerable,
Or live with the fact that we need this extra runtime as well.
While some of us don't even have anything to do with Azure.
Reacted by Erik Ejlskov Jensen, Alexander Kot, Shashank Kedia and Justin Toth
Activity
David-Engel commentedon Jan 20, 2024
I suspect it was the bump in the Azure.Identity dependency version in 5.1.4 to address the Azure.Identity vulnerability. Does the same thing result from only bumping to MDS 5.1.3? The only thing that changed from 5.1.3 to 5.1.4 was that dependency version. I don't think there will be anything we can do about it if Azure.Identity is bringing in the Desktop Runtime requirement.
AlexanderKot commentedon Jan 20, 2024
Have tested with 5.1.3 - it is OK no Desktop needed.
So you are right.
It will be surprise for many projects, as it happens for us.
In any case having such direct dependency in so low level lib looks not very good.
Seems such services better manage with DI. Not all projects using MSSQL run in Azure.
Just having this dependency cause loading additional 700K of dlls with unneeded functionality.
kedia990 commentedon Jan 21, 2024
This broke upgraded applications in our environment as well. We containerize ASP.NET Core workloads and run them with the
dotnet/aspnet:8.0-nanoserver-ltsc2022base layer; they work fine until MDS 5.1.3. When we upgrade to MDS 5.1.4, they fail to start up (failure log below). FWIW, we don't use Azure Identity services for these applications either.ErikEJ commentedon Jan 22, 2024
@kedia990 What is the target framework of all your projects?
AlexanderKot commentedon Jan 22, 2024
In our project net7.0-windows
ErikEJ commentedon Jan 22, 2024
@AlexanderKot That seems to be by design in Azure.Identity - why do you need net7.0-windows ??
bdemolder commentedon Jan 22, 2024
We have noticed the same issue, in a pure ASP.Net Core API (REST), suddenly we need the Desktop Runtime. Will try 5.1.3 for now as well.
AlexanderKot commentedon Jan 22, 2024
We use net7.0-windows because of
300+ Warnings
CA1416 This call site is reachable on all platforms. 'XXXX' is only supported on: 'windows'.
And we are not ready to clean this out
JRahnama commentedon Jan 22, 2024
@AlexanderKot this is by design when using WAM (Web Account Manager).
When targeting
net-windowsWAM is included by default.Read more here.
I would suggest using
inside problematic classes/functions and convert the TFM
net7.0AlexanderKot commentedon Jan 22, 2024
Thank you
we can use many workarounds including proposed by you.
But we are not unique with this problem, and before 5.1.4 it was no such dependency.
Ideal solution could be removing direct dependency to Azure libs from DB access lib, and embed it using DI whenever it is really needed. Lets imagine that instead Azure we need AWS infrastructure ...
I understood that chances that this will happens are minimal. :(
JRahnama commentedon Jan 22, 2024
@AlexanderKot, I guess this is something new which was added to the latest release of Microsoft.Identity.Client. I can happily transfer the issue to that repository or you can open an issue with them. As SqlClient driver we do not have any control over that behavior.
kedia990 commentedon Jan 22, 2024
@ErikEJ we're targeting
net8-windowsin our affected projects. That's intentional and required: we depend on certain libraries that use Windows-specific APIs, and it's not something that we can trivially eliminate (and we therefore containerize such applications on Windows hosts with thedotnet/aspnet:8.0-nanoserver-ltsc2022base layer). And to clarify (again), we do not require any Azure Identity services; the stuff we're doing is all on-premise.(Cross-referencing the related AzureAD/microsoft-authentication-library-for-dotnet#4468 for my easy reference / might be interesting to the rest of the audience here.)
JRahnama commentedon Jan 22, 2024
Also to mention that we have this work item, but yet not decided about a date or its necessity/urgency.
bdemolder commentedon Jan 23, 2024
What I can see is from the dependency graph (made it myself):

But the main problem is that Azure.Identity 1.7.0 is marked as Vulnerable as well...
And if we manually set Azure.Identity to the last non-vulnerable one (1.10.2), it needs:
Microsoft.Identity.Client (>= 4.54.1)
Which by itself - I think - requires .Net Desktop Runtime like previously mentioned.
So for most of us there is either a choice of using the MDS 5.1.3 with Azure.Identity (1.7.0) that is marked vulnerable,
Or live with the fact that we need this extra runtime as well.
While some of us don't even have anything to do with Azure.
kf-gonzalez commentedon Jan 23, 2024
Closing, related to #1108
ErikEJ commentedon Aug 2, 2024
For anyone faced with this, here is a fix: dotnet/efcore#34331 (comment)
gfody commentedon Aug 19, 2024
I encountered this rev'ing MDS from 5.1.2 to 5.2.1 and adding the package reference to Azure.Identity 1.12.0 didn't help, fwiw