asp.net-core-2.0

asp.net core headers caching issue

邮差的信 提交于 2021-01-29 02:50:09
问题 Here are the request headers from postman to my asp.net_core 2.0 API. Content-Type: application/json Accept: application/json Response from my asp.net core application is an exception thrown in a string format. But the below response headers have been sent from the API to postman. Cache-Control : no-cache, no-store, must-revalidate Pragma : no-cache Transfer-Encoding : chunked Content-Type : application/json ; charset=utf-8 Age : 0 Server : Kestrel Since the Request body is a string , and the

Cannot create a DbSet for 'OpenIddictApplication' because this type is not included in the model for the context

梦想的初衷 提交于 2021-01-28 15:47:54
问题 I am trying to customize the OpenIddictApplication table and i am succeeded about that. My problem is that when i try to generate token i got the following error "Cannot create a DbSet for 'OpenIddictApplication' because this type is not included in the model for the context". Here is my service configuration: public void ConfigureServices(IServiceCollection services) { services.AddMvc().AddXmlSerializerFormatters(); services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); services

Cannot create a DbSet for 'OpenIddictApplication' because this type is not included in the model for the context

谁都会走 提交于 2021-01-28 15:40:17
问题 I am trying to customize the OpenIddictApplication table and i am succeeded about that. My problem is that when i try to generate token i got the following error "Cannot create a DbSet for 'OpenIddictApplication' because this type is not included in the model for the context". Here is my service configuration: public void ConfigureServices(IServiceCollection services) { services.AddMvc().AddXmlSerializerFormatters(); services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); services

Cannot create a DbSet for 'OpenIddictApplication' because this type is not included in the model for the context

独自空忆成欢 提交于 2021-01-28 15:39:02
问题 I am trying to customize the OpenIddictApplication table and i am succeeded about that. My problem is that when i try to generate token i got the following error "Cannot create a DbSet for 'OpenIddictApplication' because this type is not included in the model for the context". Here is my service configuration: public void ConfigureServices(IServiceCollection services) { services.AddMvc().AddXmlSerializerFormatters(); services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>(); services

ASP .NET Core Identity SignInManager

旧城冷巷雨未停 提交于 2021-01-28 08:52:12
问题 Good day. ASP.NET-Core project was with out authentication. So, I tried to add built-in Identity for this purpose. Tables in database successfully created, new user registered. In Account controller in Login Method SignInManager return success in process. In partial view, where links for Login\Register added injection and library (all looks as default project with authentication, based on its implementation): @using Microsoft.AspNetCore.Identity @inject SignInManager<ApplicationUser>

How to change URL Suffix of .net core?

隐身守侯 提交于 2021-01-28 03:31:31
问题 How can I have the following route: http://localhost:4413/abc/ And the following route: http://localhost:4413/abc.html both return the same controller method, using .NET Core MVC? 回答1: It sounds like you want two suffixes to reach the same controller action. an empty suffix an .html suffix Here is one way to do that in your Startup.Configure method. Edit its app.UseMvc to look like this: app.UseMvc(routes => { // this is the default route that is already present routes.MapRoute( name:

How can I upgrade from .Net Core 2.1 RC1 to the stable version of .NET Core 2.1?

那年仲夏 提交于 2021-01-28 03:14:41
问题 Needing SignalR, having started my project before 30th May, when the stable version of ASP .NET Core 2.1 was released, I opted to use ASP .NET Core 2.1 RC1. However, once the stable version is released, I'd naturally like to leave the preview version behind and upgrade to the stable version. How to do this? In order to achieve that, I went to https://www.microsoft.com/net/download/visual-studio-sdks and downloaded .NET Core 2.1 x64 installer from there. However, having installed it, I cannot

How to change URL Suffix of .net core?

霸气de小男生 提交于 2021-01-28 02:23:34
问题 How can I have the following route: http://localhost:4413/abc/ And the following route: http://localhost:4413/abc.html both return the same controller method, using .NET Core MVC? 回答1: It sounds like you want two suffixes to reach the same controller action. an empty suffix an .html suffix Here is one way to do that in your Startup.Configure method. Edit its app.UseMvc to look like this: app.UseMvc(routes => { // this is the default route that is already present routes.MapRoute( name:

How can I upgrade from .Net Core 2.1 RC1 to the stable version of .NET Core 2.1?

ぐ巨炮叔叔 提交于 2021-01-28 01:40:28
问题 Needing SignalR, having started my project before 30th May, when the stable version of ASP .NET Core 2.1 was released, I opted to use ASP .NET Core 2.1 RC1. However, once the stable version is released, I'd naturally like to leave the preview version behind and upgrade to the stable version. How to do this? In order to achieve that, I went to https://www.microsoft.com/net/download/visual-studio-sdks and downloaded .NET Core 2.1 x64 installer from there. However, having installed it, I cannot

ASP.NET Core 2 - GetUserIdAsync returning null Result with Guid Ids

只谈情不闲聊 提交于 2021-01-27 20:05:18
问题 I'm currently porting a site to ASP.NET Core 2 and am getting the following Exception thrown when I call userManager.GenerateEmailConfirmationTokenAsync(user) with a user class that extends IdentityUser<Guid> : System.ArgumentNullException: Value cannot be null. Parameter name: value at System.IO.BinaryWriter.Write(String value) at Microsoft.AspNetCore.Identity.DataProtectorTokenProvider`1.<GenerateAsync>d__11.MoveNext() GenerateAsync() makes a call to UserManager.GetUserIdAsync(), which is