[Fixed] ‘ConfigurationBuilder’ does not contain a definition for ‘SetBasePath’

I was trying to read a configuration json file, came across this error. Here is the complete error details that I have received.

Severity Code Description Project File Line Suppression State
Error CS1061 ‘ConfigurationBuilder’ does not contain a definition for ‘SetBasePath’ and no accessible extension method ‘SetBasePath’ accepting a first argument of type ‘ConfigurationBuilder’ could be found (are you missing a using directive or an assembly reference?) ConsoleApp1 C:\Users\jdbots\source\repos\ConsoleApp1\Program.cs 12 Active

Below is the code snippet where error was shown.

Fix: ‘ConfigurationBuilder’ does not contain a definition for ‘SetBasePath’

To fix this error, you will have to install a new NuGet package Microsoft.Extensions.Configuration.Json. When you install this package, automatically, the error will be resolved.

Thank you All!!! Hope you find this useful.


One thought on “[Fixed] ‘ConfigurationBuilder’ does not contain a definition for ‘SetBasePath’

Add yours

Up ↑

%d bloggers like this: