-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
CLI - dotnet workload restore
fails on solution if there is a .dcproj for Docker
#42394
Comments
dotnet workload restore
fails on solution if there is a .dcproj for Dockerdotnet workload restore
fails on solution if there is a .dcproj for Docker
I got the same problem and also have a docker compose project in my solution I even get the problem when i specify the project directly: dotnet --info Runtime Environment: .NET workloads installed: [aspire] [ios] [maccatalyst] [maui] [maui-windows] [wasm-tools] [wasm-tools-net6] [wasm-tools-net7] Host: .NET SDKs installed: .NET runtimes installed: Other architectures found: Environment variables: global.json file: Learn more: Download .NET: |
Triage Notes
The target exists in two places: The cross-targeting targets are imported by the Microsoft.NET.Sdk.BeforeCommonCrossTargeting.targets for multi-TFM projects, and by the MIcrosoft.NET.Sdk.BeforeCommon.targets for single-targeted projects. Proposed resolution
Temporary workaround@pomianowski and @Jonas-Marty - you may be able to work around this problem by adding a dummy Target to your dcproj (and any other unsupported project types). This Target doesn't need to do any logic, it can be as simple as adding this to each project: <Target Name="_GetRequiredWorkloads" /> |
Triage: |
There's not an API-based version of 'SkipNonexistentTargets' like there is for the MSBuild intrinsic Task, so we just have to check if the target exists in the ProjectInstance. This is easy to do, so I sent a PR. |
Describe the bug
When attempting to restore workloads for the solution using the command
dotnet workload restore .\MySolution.sln
, the build fails with an error related to the docker-compose.dcproj project file.To Reproduce
Steps to reproduce the behavior:
Open a command line interface.
Navigate to the directory containing the solution file with .NET Aspire AppHost and Docker compose projects.
Run the command: dotnet workload restore .\MySolution.sln.
Observe the error.
Exceptions (if any)
Further technical details
dotnet --info
The text was updated successfully, but these errors were encountered: