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

Functions fails to enable Aspire Orchestration unless AppHost SDK is in local cache #6622

Open
1 task done
timheuer opened this issue Nov 6, 2024 · 2 comments
Open
1 task done

Comments

@timheuer
Copy link
Member

timheuer commented Nov 6, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When creating a new Azure Functions project and using 'Enlist in Aspire Orchestration' -- it will fail if the AppHost SDK package has never been used before.

Expected Behavior

Creating an Azure Function project with orchestration should work.

Steps To Reproduce

Clear nuget cache (dotnet nuget locals all -c)
File...New Azure Function
Check "Enlist in orchestration" checkbox
Fail with (this shows preview 1, but could be rc1 depending on template versions installed):
Image

[Workaround]
Create an Aspire app with the apphost sdk on the machine -- this will force a restore and cache the package
the above flow should now work

Exceptions (if any)

No response

.NET Version info

No response

Anything else?

No response

@joperezr
Copy link
Member

joperezr commented Nov 6, 2024

Thanks for logging this, @timheuer. I don't think this is isolated to Functions projects, and should be able to be reproduced with any type of project when trying to add Aspire orchestration.

MSBuild SDKs are special type of NuGet packages, and are restored in a special way by both VS and the CLI, as they need to be restored very early in the project evaluation, even before the "real" NuGet package restore. My bet is that this special logic doesn't handle correctly the case where a project that is being dynamically being added to a solution depends on an MSBuild SDK NuGet package which is not in the cache yet. We should further investigate to confirm what the issue is and what the best course of action should be to address it.

cc: @phenning @DamianEdwards

@joperezr
Copy link
Member

joperezr commented Nov 6, 2024

One potential workaround we can consider, is to make sure that every time we insert the Aspire templates into Visual Studio, we also insert the MSBuild SDK into VS's offline cache, so that this issue is less likely to be hit. It would still obviously be potentially hit if people reference a different SDK than the one we inserted in the offline cache.

@joperezr joperezr added this to the Backlog milestone Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants