'working directory of .net core service is wrong when running from CLI

I'm trying to run my .net core web api service from the .net CLI. My solution is build with vs2022 to the path:

C:\myProject\Bin

When I try to use the

dotnet myService.dll

command, I see that it is executed from the path:

C:\Program Files\dotnet

But when this is the working directory, my service can't find referenced projects that are built to my "C:\myProject\Bin" folder.

When I run my service using VS2022, It runs from the correct folder and finds all the references that it needs.

What am i doing wrong?
can I make the

dotnet myService.dll

command run from the proper directory?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source