-
Notifications
You must be signed in to change notification settings - Fork 522
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
[WebToolsE2E][Aspire] After installing both aspire9 and aspire8, creating aspire-starter-8 fails with error: "The constraint 'workload' failed to initialize ..." #6267
Comments
That would have worked because when you installed the .NET Aspire SDK as part of VS it would have installed the .NET Aspire 8.0 workload. You can probably confirm this with |
Those are not errors, they are just messages saying that some of the templates you are installing will not be available given they depend on the workload and you don't have it installed. I understand how this message can be confusing, but this is expected and the right behavior as we don't want those templates to show if you don't have the workload installed. |
As for this issue and the problem that @v-elenafeng is hitting, it is due to this templating issue: dotnet/templating#7946 That issue describes a race condition that is happening in the template loading engine when trying to resolve which workloads are installed in order to find out if the constraints on the templates are satisfied or not. This only happens to our downlevel templates (i.e. aspire-starter-8) because those are the only ones that have a constraint to only work in case the workload is installed. Since this is a race condition, it will fail some times and work other times, like @v-elenafeng found above. I chatted about this issue with @marcpopMSFT and @dsplaisted who own the template engine but unfortunately it looks like the fix is not trivial here. |
I don't think the warning showing up is related to the race condition bug that we have but rather the template engine constraint feature appears to not expect you to have a valid template and a constrained template in the same package. We should probably suppress that message when not targeting the template that has the constraint. Is that what v-elenafeng is reporting? I also see a report above that sometimes it works and sometimes it doesn't which I guess would point to the race condition but we were getting a very different error experience before. CC @baronfel |
No, the warning regarding the templates was just a comment from @davidfowl which as you pointed out is just expected. The original issue getting reported here by @v-elenafeng is the duplicate issue we've talked about this past week. If you go to the top post and look at the first screenshot in the |
Ahh got it now. I was thinking we'd see the access violation but that's a different result from the same issue. @dsplaisted we discuss potentially handling the duplicate situation better before we realized this was a parallelization issue. We could potentially still work around this by making that original proposed fix (which was to not report the duplicate if they were the exact same file loaded twice). Thoughts? |
If we want to make a simple-ish fix, I would try to update WorkloadConstraintFactory to put the equivalent of a lock around the |
We should verify if this still repros after the consolidated templates. |
@joperezr this issue itself does not apply anymore with the change to Aspire 9 templates in GA. Do we need to still need to keep this issue open to track the fix for workload constraints in the sdk? Or perhaps open a separate issue in the sdk repo to track that? |
No need to keep this open, as templating already has an issue tracking the fix for this: dotnet/templating#7946 Closing this as not applicable for Aspire any longer. |
REPRO STEPS
aspire--starter-8
project, you will see another issue #6263aspire-starter-8
project againACTUAL
After installing aspire8 workload, creating
aspire-starter-8
project still failsAccording to the error details, run
dotnet new aspire-starter-8 -o aspire09 --force
EXPECTED
Create
aspire-starter-8
project successfullyThe text was updated successfully, but these errors were encountered: