Reputation: 6199
I a trying to set up google sign in in my .net core web api application. I have been following this guide: https://learn.microsoft.com/en-us/aspnet/core/security/authentication/social/google-logins
But for some reason i get this error:
'IConfigurationBuilder' does not contain a definition for 'AddUserSecrets' and no extension method 'AddUserSecrets' accepting a first argument of type 'IConfigurationBuilder' could be found (are you missing a using directive or an assembly reference?)
Here's my startup method, nothing special here:
public Startup(IHostingEnvironment env)
{
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);
if (env.IsDevelopment())
{
// For more details on using the user secret store see http://go.microsoft.com/fwlink/?LinkID=532709
builder.AddUserSecrets<Startup>();
}
builder.AddEnvironmentVariables();
Configuration = builder.Build();
}
Upvotes: 6
Views: 1882