Azure Functions: What Uses Microsoft.WindowsDesktop.App.Ref?

Stephen Wood 0 Reputation points
2024-08-13T21:07:48.6866667+00:00

I create an Azure timer function that targets .NET 8 - Isolated, then reference the Microsoft.Azure.Functions.Worker package. When I build this project, it generates a WorkerExtensions.csproj project in the obj[Environment\net8.0 folder. If building locally, this poses no problem.

If building within an Azure DevOps pipeline, it creates such a nearly insuperable problem. Because during the build task for your principle project, this inner project suddenly materializes, and it has dependencies that can be retrieved as part of a restore, but cannot be retrieved as part of a build (usually as a matter of policy). The issue, and a proposed workaround, are discussed in detail here.

https://github.com/Azure/azure-functions-dotnet-worker/issues/1888

The proposed workaround involves creating a dummy WorkerExtensions project that is a copy of the generated one, and then restoring its dependencies as part of the restore task. Up to now, that has worked.

But suddenly, today, the build task fails with errors that indicate it "failed to retrieve information" for these packages:

Microsoft.WindowsDesktop.App.Ref
Microsoft.AspNetCore.App.Ref
Microsoft.NETCore.App.Ref

Note that these errors occur when the build task is attempting to do a restore on the generated WorkerExtensions.csproj project.

If you attempt to add any of these projects manually, you get the following:

The package Microsoft.WindowsDesktop.App.Ref 8.0.8 has a package type DotnetPlatform that is incompatible with this project.

So now I'm at a wall where even the recommended workaround does not work. How should I proceed? Also, how would I know what in my simple timer function project depends on these these packages?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pinaki Ghatak 5,600 Reputation points Microsoft Employee Volunteer Moderator
    2024-08-14T14:50:59.7133333+00:00

    Hello @Stephen Wood

    To proceed, you could try to investigate further and identify what in your simple timer function project depends on these packages.

    One way to do this is to use the NuGet Package Manager in Visual Studio to view the dependencies of your project and see if any of them require these packages.

    Another way is to check the project file and look for any references to these packages. Once you have identified the dependencies, you could try to update them to a version that is compatible with your project.

    Alternatively, you could try to find alternative packages that provide similar functionality and are compatible with your project.

    I hope this helps.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.