[英]How to make NCrunch use specific appsettings.json file?
There are some API tests in my solution that require setting from appsettings.json
file.我的解决方案中有一些 API 测试需要从
appsettings.json
文件进行设置。 Local environment differs from DEV/PROD.本地环境不同于 DEV/PROD。 Because of that I have main
appsettings.json
config and additional appsettings.Development.json
with some settings specific for dev machine.因此,我有主要的
appsettings.json
配置和其他appsettings.Development.json
以及一些特定于开发机器的设置。
NCrunch was working fine grabbing settings from the Development config file until new configs were added:在添加新配置之前,NCrunch 可以很好地从开发配置文件中抓取设置:
appsettings.json
appsettings.Development.json
appsettings.Local.json
appsettings.Production.json
I updated launchSettings.json
file to use Local config.我更新
launchSettings.json
文件以使用本地配置。 It works fine when I run it from VS, but NCrunch still uses Development.当我从 VS 运行它时它工作正常,但 NCrunch 仍然使用开发。 Is there any way to make it use Local?
有没有办法让它使用本地?
Not tried this, but it should get you close.没有试过这个,但它应该让你接近。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.