Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

NullReferenceException in AddJsonFile Extension method

$
0
0

Hi

I am using Microsoft.Framework.ConfigurationModel and am getting the following error

System.NullReferenceException
Object reference not set to an instance of an object.
C:\Dat\Nsg\L\Web\15\vNext07\src\WebMvc\Startup.cs

Line 22:          {
Line 23:              //
Line 24:              Configuration = new Configuration().AddJsonFile("config.json");
Line 25:              //
Line 26:          }

at Microsoft.Framework.ConfigurationModel.PathResolver.get_ApplicationBaseDirectory()
at Microsoft.Framework.ConfigurationModel.PathResolver.ResolveAppRelativePath(String path)
at Microsoft.Framework.ConfigurationModel.JsonConfigurationExtension.AddJsonFile(IConfigurationSourceRoot configuration, String path, Boolean optional)
at Microsoft.Framework.ConfigurationModel.JsonConfigurationExtension.AddJsonFile(IConfigurationSourceRoot configuration, String path)
at WebMvc.Startup..ctor() in C:\Dat\Nsg\L\Web\15\vNext07\src\WebMvc\Startup.cs:line 24

I have a config.json in the wwwroot folder, but appears to have a problem with get_ApplicationBaseDirectory method.

Phil


Viewing all articles
Browse latest Browse all 9386

Trending Articles