This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
MIT License
5.25k
stars
4.58k
forks
source link
[BUG] "-windows" TargetFramework requires "Microsoft.WindowsDesktop.App" and can't be deployed to Azure #41390
Reason is the dependency Microsoft.Identity.Client, which will add WebView2 and other stuff to the dependency tree:
The problem:
a) It was quite suprising that the target runtime dependency has changed.
b) This WindowsDesktop Runtime is not available on Azure (e.g. App Service).
Expected behavior
It seems wrong that the TargetFramework "net6.0-windows" is treated like "the application will be run on a desktop environment".
I always thought that "net6.0-windows" is for applications that uses Windows Specific APIs, which might be a Web Application. With the current behavior we had to use "net6.0" (which is in the end a good thing, but feels a bit drastic just because one NuGet package has a weird feature backed in).
Actual behavior
The desktop runtime is required.
Reproduction Steps
Create a MVC App and use "net6.0-windows" (or net8.0-windows) as TargetFramework
Add Azure.Identity
Deploy to azure
Result:
You must install or update .NET to run this application.
App: C:\inetpub\wwwroot\primedocs\Service\PrimeDocs.Service.Host.dll
Architecture: x64
Framework: 'Microsoft.WindowsDesktop.App', version '6.0.0' (x64)
.NET location: C:\Program Files\dotnet\
No frameworks were found.
Learn about framework resolution:
https://aka.ms/dotnet/app-launch-failed
Library name and version
Azure.Identity 1.10.4
Describe the bug
When you create a "Windows" specific Web Application like that:
Then the resulting project will require the WindowsDesktop runtime:
Reason is the dependency![image](https://github.com/Azure/azure-sdk-for-net/assets/756703/53bec7c9-9588-4c3d-be2d-540df82ccf5e)
Microsoft.Identity.Client
, which will add WebView2 and other stuff to the dependency tree:The problem: a) It was quite suprising that the target runtime dependency has changed. b) This WindowsDesktop Runtime is not available on Azure (e.g. App Service).
Expected behavior
It seems wrong that the TargetFramework "net6.0-windows" is treated like "the application will be run on a desktop environment". I always thought that "net6.0-windows" is for applications that uses Windows Specific APIs, which might be a Web Application. With the current behavior we had to use "net6.0" (which is in the end a good thing, but feels a bit drastic just because one NuGet package has a weird feature backed in).
Actual behavior
The desktop runtime is required.
Reproduction Steps
Result:
Environment
Azure App Service