asp.net-core-2.0

IdentityServer Session cookie is not sliding

余生长醉 提交于 2020-03-05 05:38:45
问题 I am facing a weird problem. I am able to do the silent renew, but my IdP cookie is getting sliding. More into the problem... I have an IdP session cookie (IdentityServer) lifetime set to expire in 15 minutes and I kept the same time for the access token and id token lifetime too. On my JavaScript client, I check user activity every 2 minutes and if there is activity in the last 2 min, I will renew the token. I am able to get the access token and id token with renewed expiration times, but

ASP.NET Core 2 template missing in VS 2017

百般思念 提交于 2020-03-01 06:26:29
问题 I'm using VS 2017 Community Edition. I've installed .NET Core 2 SDK from here. When I run dotnet --version I get reply like following But I can't see the ASP.NET Core 2 template , instead I see following template. How will I get ASP.NET Core 2 template like this https://blogs.msdn.microsoft.com/webdev/2017/08/14/announcing-asp-net-core-2-0/#attachment_10076 回答1: The current version of VS 2017 is 15.3.2. Try running the Visual Studio Installer and see if it doesn't offer you an upgrade. The

ASP.NET Core 2 template missing in VS 2017

空扰寡人 提交于 2020-03-01 06:26:16
问题 I'm using VS 2017 Community Edition. I've installed .NET Core 2 SDK from here. When I run dotnet --version I get reply like following But I can't see the ASP.NET Core 2 template , instead I see following template. How will I get ASP.NET Core 2 template like this https://blogs.msdn.microsoft.com/webdev/2017/08/14/announcing-asp-net-core-2-0/#attachment_10076 回答1: The current version of VS 2017 is 15.3.2. Try running the Visual Studio Installer and see if it doesn't offer you an upgrade. The

How to implement authorization using GraphQL.NET at Resolver function level?

不打扰是莪最后的温柔 提交于 2020-02-28 06:41:09
问题 I am looking for sample code and examples regarding how to implement authorization at resolver function level using GraphQL.NET and ASP.NET CORE 2. Basically I am trying to prevent the execution of query if the request is not authorized. Can anyone help me to get some good tutorials or code samples as reference for the implementation. 回答1: For graphql-dotnet/authorization, the page for AspNetCore has not been released, refer Add GraphQL.Server.Authorization.AspNetCore NuGet package #171. You

SignalR Failed to start the connection

你离开我真会死。 提交于 2020-02-25 05:59:45
问题 I have an angular application along with an ASP.NET Core 2.2 backend that uses SignalR. When starting the connection, I receive the errors: Error: Failed to complete negotiation with the server: Error Error: Failed to start the connection: Error Response Headers when hitting localhost:5000/chatHub- HTTP/1.1 204 No Content Date: Tue, 19 Feb 2019 08:52:52 GMT Server: Kestrel Access-Control-Allow-Headers: x-requested-with Access-Control-Allow-Methods: POST Access-Control-Allow-Origin: * Startup

SignalR Failed to start the connection

别来无恙 提交于 2020-02-25 05:59:05
问题 I have an angular application along with an ASP.NET Core 2.2 backend that uses SignalR. When starting the connection, I receive the errors: Error: Failed to complete negotiation with the server: Error Error: Failed to start the connection: Error Response Headers when hitting localhost:5000/chatHub- HTTP/1.1 204 No Content Date: Tue, 19 Feb 2019 08:52:52 GMT Server: Kestrel Access-Control-Allow-Headers: x-requested-with Access-Control-Allow-Methods: POST Access-Control-Allow-Origin: * Startup

How to build IOptions<T> for testing?

大憨熊 提交于 2020-02-24 10:50:20
问题 In ASP.NET Core 2 i have the following class that takes IOptions<T> public class MyOptions { public string Option1 { get; set; } public string Option2 { get; set; } } public class MyService:IMyService { private readonly MyOptions _options; public MyService(IOptions<MyOptions> options) { _options = options.Value; } } appsettings.json { "Logging": { "IncludeScopes": false, "LogLevel": { "Default": "Warning" } }, "MyOptions": { "Option1": "option 1 value", "Option2": "option 2 value" } } Then i

How to build IOptions<T> for testing?

。_饼干妹妹 提交于 2020-02-24 10:50:06
问题 In ASP.NET Core 2 i have the following class that takes IOptions<T> public class MyOptions { public string Option1 { get; set; } public string Option2 { get; set; } } public class MyService:IMyService { private readonly MyOptions _options; public MyService(IOptions<MyOptions> options) { _options = options.Value; } } appsettings.json { "Logging": { "IncludeScopes": false, "LogLevel": { "Default": "Warning" } }, "MyOptions": { "Option1": "option 1 value", "Option2": "option 2 value" } } Then i

What is the alternate of [AllowHtml] in ASP.Net Core 2.0 [duplicate]

依然范特西╮ 提交于 2020-02-24 08:59:35
问题 This question already has an answer here : Generate web page from Database using AllowHtml in Asp.Net Core 2.0 (1 answer) Closed 2 years ago . I want to integrate CKEditor in my MVC Core 2.0 Application, in previous version I used it by adding [AllowHTML] data annotation to my string property. But in ASP.Net Core I could not find the right way to insert HTML into string input. My code in in ASP.Net MVC 5 [AllowHtml] [DataType(DataType.MultilineText)] public string Profile { get; set; } but in

HTTP Error 500.24 - Internal Server Error : system.web/identity@impersonate is set to true

瘦欲@ 提交于 2020-02-23 08:42:46
问题 I created an ASP.NET web application MVC Core 2.2 project. Then I ran it in IIS Express. But I received the following error: HTTP Error 500.24 - Internal Server Error An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode. Most likely causes: system.web/identity@impersonate is set to true. Things you can try: If the application supports it, disable client impersonation. If you are certain that it is OK to ignore this error, it can be disabled by setting