如何从外部工作目录中执行dotnet .dll
我正在尝试从外部执行dotnet .dll,其构建目录(工作目录)。
当我这样做时,appsettings.json文件将被忽略。
有没有办法设置工作目录?或者我可以指定AppSettings.json文件的位置?
类似的内容:
# 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
详细信息
C:\root
└───build
├───appsettings.json
└───hello.dll
工作:
cd C:\root\build
dotnet hello.dll
不起作用(忽略AppSettings.json):
cd C:\root
dotnet build/hello.dll
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论