I have a Visual Studio 2022 solution with eight existing projects: three “ASP.NET Core Web API” projects, three “xUnit Test” projects, one “Class Library” project, and one “React App” TypeScript project. The solution uses Docker Compose for its container orchestration (so that I can include a database container, a message queue container, and an NGINX frontend container). All the existing projects work fine at this point.
I added one new “ASP.NET Core Web API” project to the solution and added some initial testing code. When I try to build the project, all the other containers continue to work, but the new container just reports:
The command could not be loaded, possibly because:
* You intended to execute a .NET application:
The application '' does not exist.
* You intended to execute a .NET SDK command:
No .NET SDKs were found.
Note the '' application name in the error message. Both the Dockerfile and the docker-compose.yml file specify proper entrypoints (dotnet project .dll) with the correct application name and the container works when launched manually; it’s just when launched through the Visual Studio Docker Compose launch profile that it fails.
I found a reference to the obj/Docker/docker-compose.vs.debug.g.yml file, where I found the direct cause:
com.microsoft.visualstudio.debuggee.arguments: " --additionalProbingPath /.nuget/packages --additionalProbingPath /.nuget/fallbackpackages \"\""
What causes this and how can it be resolved within Visual Studio (as opposed to just editing the generated file)?
Addendum I tried modifying that obj/Docker/docker-compose.vs.debug.g.yml file; it didn’t work, and as soon as i cleaned the solution in preparation for another build, that file disappeared. so it’s obviously generated from other information.