when implement middleware to validate token result show correct but give me error null connectionstring ?
i get errror below in case of using app.UseTokenAuth(); :
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
app.UseHsts();
}
app.UseTokenAuth();
app.UseHttpsRedirection();
app.UseMvc();
app.UseStaticFiles();
app.UseDefaultFiles();
}
As bruce said, please check your DefaultConnection.And could you share a demo that could reproduce your issue.Actually you posted the missing code(e.g. how did you register InstallServicesInAssembly...) ,so I could not reproduce.
Did you make error if you use the default services like below:
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
41 Points
376 Posts
when implement middleware to validate token result show correct but give me error null connection...
Sep 12, 2019 03:49 PM|ahmedbarbary|LINK
problem
when implement middleware to validate token result show correct but give me error null connectionstring ?
i get errror below in case of using app.UseTokenAuth(); :
but without this line no error connection
full errror show
so that what is the problem please
All-Star
58484 Points
15803 Posts
Re: when implement middleware to validate token result show correct but give me error null connec...
Sep 12, 2019 04:16 PM|bruce (sqlwork.com)|LINK
the error says its you sqlserver contection is null:
Contributor
2720 Points
874 Posts
Re: when implement middleware to validate token result show correct but give me error null connec...
Sep 13, 2019 06:04 AM|Rena Ni|LINK
Hi ahmedbarbary,
As bruce said, please check your DefaultConnection.And could you share a demo that could reproduce your issue.Actually you posted the missing code(e.g. how did you register InstallServicesInAssembly...) ,so I could not reproduce.
Did you make error if you use the default services like below:
Best Regards,
Rena