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?