
Here I am applying the asp.net core identity for user signup


Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Tahir AnsariRank #366 · 6.8K reputationPosted Aug 9, 2023, 8:50 AM EDT
Exception clearly saying your connection was not initialized.
Please check your connectionstring in appsettings.json file also check program.cs file
Praveen Paswan44 reputationPosted Aug 11, 2023, 1:41 AM EDT
Create a ConnectionString in appsetting.json file under the
"AllowedHosts": "*",
"ConnectionStrings": {;User Id=sa;Password=*****;Database=;TrustServerCertificate=True;"
"ConStr": "Data Source=
}
Add Service in "Program.cs" class (Asp,Net Core 6.0 and Above):
builder.Services.AddDbContext<your DbContext>(options => options.UseSqlServer(builder.Configuration.GetConnectionString("ConStr")));
Add Service in "Startup.cs" class(Asp.Net Core 5.0) :
In ConfigureServices Method
services.AddDbContext<your DbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("ConStr")))
Mohammad HussainRank #513 · 4.8K reputationPosted Aug 9, 2023, 8:49 AM EDT
It looks like you're encountering an issue related to connection property initialization in ASP.NET. The error you mentioned, "Invalid operation. Connection property is not initialized," suggests that there might be an issue with the way you're using the
_SigninManagerand_autoserviceobjects.Check Initialization of
_SigninManagerand_autoserviceObjects: Ensure that both_SigninManagerand_autoserviceobjects are properly initialized before using them. Make sure that you have the necessary references and configurations set up for both objects.var result = _SigninManager.PasswordSignInAsync(username, password, false, lockoutfailure, false).Result;It's generally recommended to use
awaitinstead of.Resultto avoid blocking. If_SigninManager.PasswordSignInAsyncis an asynchronous method, make sure you are usingawaitcorrectly and that the containing method is also marked asasync.Cr BhargaviRank #420 · 5.9K reputationPosted Aug 13, 2023, 4:13 AM EDT
Check Initialization of
_SigninManagerand_autoserviceObjects: Ensure that both_SigninManagerand_autoserviceobjects are properly initialized before using them. Make sure that you have the necessary references and configurations set up for both objects.