Reputation: 2074
I am using asp.net 5 with mvc6, and I extended the project.json with several stuffs.
I am currently reading the project.json by parsing it myself. But I was wondering whether a service or a context exists within mvc6 already providing parsed data of project.json file.
Upvotes: 1
Views: 57
Reputation: 2756
Why are you parsing manually project.json? Don't do that. If you wan't to have custom configuration settings then create new file or use one of existing ones (for example appsettings.json). Then in Startup.cs simply add that file and it will be available in the Configuration object:
public Startup(IHostingEnvironment env)
{
var builder = new ConfigurationBuilder().AddJsonFile("appsettings.json");
...
Configuration = builder.Build();
}
Upvotes: 0