asp.net - ASP .NET Core 1.1 web api using Secret Manager tool -
i trying set google sign in in .net core web api application. have been following guide: https://docs.microsoft.com/en-us/aspnet/core/security/authentication/social/google-logins
but reason error:
'iconfigurationbuilder' not contain definition 'addusersecrets' , no extension method 'addusersecrets' accepting first argument of type 'iconfigurationbuilder' found (are missing using directive or assembly reference?)
here's 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()) { // more details on using user secret store see http://go.microsoft.com/fwlink/?linkid=532709 builder.addusersecrets<startup>(); } builder.addenvironmentvariables(); configuration = builder.build(); }
you need add relevant package use it. package called microsoft.extensions.configuration.usersecrets, can learn more here.
Comments
Post a Comment