.net 能否在VS2015中转换*.json文件

.net 能否在VS2015中转换*.json文件,.net,visual-studio-2015,.net,Visual Studio 2015,我正在试用VS2015的所有新功能,我想知道我是否仍然可以在project.json或config.json文件上应用转换?正如我们可以使用web.config=>web.Debug.config和web.Release.config所做的一样。根据David Fowler的说法,这并不存在,也没有计划添加它: @vcsjones:目前是否存在或将来是否会存在类似project.json的XDT转换 @大卫猫头鹰:没有 以防万一有人碰到这个。而您不能进行XDT转换。通过Config.json,

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

根据David Fowler的说法,这并不存在,也没有计划添加它:

@vcsjones:目前是否存在或将来是否会存在类似project.json的XDT转换

@大卫猫头鹰:没有


以防万一有人碰到这个。而您不能进行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;