Why does Visual Studio tell me that the AddJsonFile() method is not defined?

問題:

I'm developing an ASP.NET 5 WebAPI project using VS Ultimate 2015 Preview.我正在使用 VS Ultimate 2015 Preview 開發一個 ASP.NET 5 WebAPI 項目。 I'm trying to configure the app in this way (line numbers are just guides):我正在嘗試以這種方式配置應用程序(行號只是指南):

1 using Microsoft.Framework.ConfigurationModel;
2
3 public IConfiguration Configuration { get; private set; }
4 
5 public Startup()
6 {
7     Configuration = new Configuration()
8         .AddJsonFile("config.json")
9         .AddEnvironmentVariables();
10 }

Line 8 gives me an error: 'Configuration' does not contain a definition for 'AddJsonFile'...第 8 行給了我一個錯誤:“配置”不包含“AddJsonFile”的定義...

What is wrong?怎麼了?


解決方案:

參考: https://stackoom.com/en/question/1qtQv
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章