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

Update for .NET 9 #6947

Draft
wants to merge 28 commits into
base: master
Choose a base branch
from
Draft

Update for .NET 9 #6947

wants to merge 28 commits into from

Conversation

cquirosj
Copy link
Contributor

@cquirosj cquirosj commented Jan 3, 2025

No description provided.

@cquirosj cquirosj force-pushed the support-net9 branch 5 times, most recently from 1af7ccb to 73a36ba Compare January 3, 2025 21:12
@hazel-bohon
Copy link
Contributor

The error occurs when building samples/hosting/aspire/Core_9/AspireDemo.AppHost/AspireDemo.AppHost.csproj it seems that there is a dependency on aspire which needs to be installed:

  Error: C:\Program Files\dotnet\sdk\9.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: aspire [D:\a\docs.particular.net\docs.particular.net\samples\hosting\aspire\Core_9\AspireDemo.AppHost\AspireDemo.AppHost.csproj]
  Error: C:\Program Files\dotnet\sdk\9.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [D:\a\docs.particular.net\docs.particular.net\samples\hosting\aspire\Core_9\AspireDemo.AppHost\AspireDemo.AppHost.csproj]

I downloaded it and ran it in my local environment and got the same error. In local env, the solution is to just run the suggested command and it runs just fine. I am not 100% sure how we ought to resolve this in the CI though. I think we probably need to add the command dotnet workload restore right before line 110 in the build-samples-and-snippets.ps1 file.

We could add a logic test of some sort to only run the command for those solutions which need it, but unless it leads to unacceptably slow performance, I think that it would be best practice to just run it all the time for every solution. So, that this doesnt accidentally catch some future dev by surprise when they add a sample that has a build dependency not normally anticipated by the script.

@cquirosj cquirosj force-pushed the support-net9 branch 5 times, most recently from 533cb43 to e9dea92 Compare January 10, 2025 03:47
@soujay soujay self-assigned this Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants