gpt4 book ai didi

.net - 你能在 VS2015 中转换 *.json 文件吗

转载 作者:行者123 更新时间:2023-12-04 11:05:08 25 4
gpt4 key购买 nike

我正在试用 VS2015 的所有新功能,我想知道我是否仍然可以对 project.json 或 config.json 文件应用转换?就像我们可以用 web.config => web.Debug.config 和 web.Release.config 做的一样。

最佳答案

以防万一其他人遇到这个。虽然你不能做 XDT 转换。使用 Config.json,您可以添加特定于环境的配置。

// Setup configuration sources.
var configuration = new Configuration()
.AddJsonFile("config.json")
.AddJsonFile($"config.{env.EnvironmentName}.json", optional: true);

if (env.IsEnvironment("Development"))
{
// This reads the configuration keys from the secret store.
// For more details on using the user secret store see http://go.microsoft.com/fwlink/?LinkID=532709
configuration.AddUserSecrets();
}
configuration.AddEnvironmentVariables();
Configuration = configuration;

Asp.Net 5.0 Docs -> Configuration

关于.net - 你能在 VS2015 中转换 *.json 文件吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27379183/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com