I am trying to execute a dotnet .dll from outside it's build directory (working directory).
When I do that the appsettings.json file is ignored.
Is there a way to set the working directory? Or can I specify where the appsettings.json file is located?
something like that:
# option A:
$env:DOTNET_WORKING_DIRECOTRY = "C:\root\build"
dotnet c:\root\build\hello.dll
# option B:
dotnet c:\root\build\hello.dll --appsettings c:\root\build\appsettings.json
Details
C:\root
└───build
├───appsettings.json
└───hello.dll
works:
cd C:\root\build
dotnet hello.dll
does not work (ignores appsettings.json):
cd C:\root
dotnet build/hello.dll