.net-core-3.1

Visual Studio 2019 creating .NetStandard 2.0.3 libraries instead of 2.1 inside a .Net Core 3.1 solution

半城伤御伤魂 提交于 2020-05-30 05:15:47
问题 i've recently (yesterday) updated visual studio 2019. I have access to .net core 3.1 sdk and can create .net core 3.1 projects. However, when i try to create a .net standard library, it defaults to 2.0.3 instead of 2.1. As far as i understand, .net standard 2.1 should come with .net core 3.1. Am i misunderstanding something here? 回答1: Create a blank solution and add a new Class Library (.NET Standard) . In properties change the target framework to .NET Standard 2.1 Save the changes and click

How do I setup Swashbucle v5 with swagger when I have a custom base url?

拟墨画扇 提交于 2020-05-27 13:23:27
问题 I am upgrading a .net API to .net Core 3.1 and using Swashbuckle.AspNetcore 5.4.1. The API is running inside a ServiceFabric app. I found this https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/1173 and tried to follow that and swagger gets generated but if I try to use the Swagger UI to send requests the request URL is with the wrong IP so the request fail. In the old Swashbuckle 4.0.1 setup we did not specify host, only the reelative basePath. How can I archieve the same?

ASP.NET Core 3.1 “'User' does not contain a definition for 'FindFirstValue'”

烂漫一生 提交于 2020-05-17 06:36:29
问题 While trying to implement the answer from here > How to get the current logged in user Id in ASP.NET Core and the user redirected me to here > https://github.com/dotnet/aspnetcore/issues/18348 var UserId = User.FindFirstValue(ClaimTypes.Name); ^ This is not working, and prints the following error 'User' does not contain a definition for 'FindFirstValue' Edit: Adding controller snippet The full snippet of my controller... using System; using System.Collections.Generic; using System.Linq; using

Angular 9 throw error 'missing required parameter' on requesting token from Azure B2C

送分小仙女□ 提交于 2020-05-16 22:36:28
问题 I am working on Angular 9 application with .NET CORE Web API 3.1 application. I configure Angular client App to authenticate using Auth 2.0 Azure B2C and angular-oauth2-oidc in Angular. I am getting error on requesting token and CORS Policy in Browser. Screen shot at the end {"error":"invalid_request","error_description":"AADB2C90083: The request is missing required parameter: grant_type.\r\nCorrelation ID: xxxx5370-695b-4f09-b583-e67600000000\r\nTimestamp: 2020-05-07 15:23:06Z\r\n"} I

Replicate cURL Command Using Redirect and Cookies in .Net Core 3.1

回眸只為那壹抹淺笑 提交于 2020-04-18 05:37:02
问题 This one seems a long shot. But I have seen several answers that indicate that HttpClient (and similar) should be used when cURL is needed in a .Net Core Application. I have the following cURL command (that works perfectly): curl -v -L --negotiate -u : -b ~/cookiejar.txt "https://idp.domain.net/oauth2/authorize?scope=openid&response_type=code&redirect_uri=https://localhost:5001&client_id=client_id_here" The flow of this command goes like this: Loads the provided url (https://idp.domain.net

Replicate cURL Command Using Redirect and Cookies in .Net Core 3.1

我的未来我决定 提交于 2020-04-18 05:36:22
问题 This one seems a long shot. But I have seen several answers that indicate that HttpClient (and similar) should be used when cURL is needed in a .Net Core Application. I have the following cURL command (that works perfectly): curl -v -L --negotiate -u : -b ~/cookiejar.txt "https://idp.domain.net/oauth2/authorize?scope=openid&response_type=code&redirect_uri=https://localhost:5001&client_id=client_id_here" The flow of this command goes like this: Loads the provided url (https://idp.domain.net

NuGet Package is Looking for Exact Version

寵の児 提交于 2020-04-11 18:32:24
问题 I have a NuGet Package called ConfigurationManagement . It has a dependency on the Nuget Package called Jil (json parser). The version listed is 2.15.4. I have another package called Logging.Client that needs Jil 2.17.0. When I look at them, the ConfigurationManagement package says it needs >= 2.15.4. Which leads me to think that I should just be able to use 2.17.0. But when I try to do that, I get the following runtime error: System.IO.FileNotFoundException: 'Could not load file or assembly

NuGet Package is Looking for Exact Version

寵の児 提交于 2020-04-11 18:32:06
问题 I have a NuGet Package called ConfigurationManagement . It has a dependency on the Nuget Package called Jil (json parser). The version listed is 2.15.4. I have another package called Logging.Client that needs Jil 2.17.0. When I look at them, the ConfigurationManagement package says it needs >= 2.15.4. Which leads me to think that I should just be able to use 2.17.0. But when I try to do that, I get the following runtime error: System.IO.FileNotFoundException: 'Could not load file or assembly

Any way to create a JWT token with key size 512? and changing default minimum size requirement of AsymmetricSignatureProvider

为君一笑 提交于 2020-04-07 08:27:28
问题 I am currently getting following error: IDX10630: The 'Microsoft.IdentityModel.Tokens.RsaSecurityKey, KeyId: '...', InternalId: '5a946596-9fe6-4c91-8c52-9b140849c7a4'.' for signing cannot be smaller than '2048' bits. KeySize: '512' I use the following method: public string GetIdTokenString(Dictionary<string, string> inputClaims, string privateKey) { string result = null; try { var tokenHandler = new JwtSecurityTokenHandler(); privateKey = privateKey.Replace("-----BEGIN ENCRYPTED PRIVATE KEY--

Any way to create a JWT token with key size 512? and changing default minimum size requirement of AsymmetricSignatureProvider

流过昼夜 提交于 2020-04-07 08:26:43
问题 I am currently getting following error: IDX10630: The 'Microsoft.IdentityModel.Tokens.RsaSecurityKey, KeyId: '...', InternalId: '5a946596-9fe6-4c91-8c52-9b140849c7a4'.' for signing cannot be smaller than '2048' bits. KeySize: '512' I use the following method: public string GetIdTokenString(Dictionary<string, string> inputClaims, string privateKey) { string result = null; try { var tokenHandler = new JwtSecurityTokenHandler(); privateKey = privateKey.Replace("-----BEGIN ENCRYPTED PRIVATE KEY--