Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found
These instructions from this blog worked for me dotnet dev-certs https –clean dotnet dev-certs https –trust Restart VS
These instructions from this blog worked for me dotnet dev-certs https –clean dotnet dev-certs https –trust Restart VS
You need the scope https://uri.paypal.com/services/reporting/search/read .. if it’s not there in the oauth2 response, double check your REST App’s permissions. Refreshing an access token Existing access tokens are cached for 9 hours–so if you already requested an API token and then just added this permission to your app, it can take up to 9 hours … Read more
You can just add <FrameworkReference Include=”Microsoft.AspNetCore.App”/> to library projects .csproj file as mentioned in the docs: <Project Sdk=”Microsoft.NET.Sdk”> <!–… rest of file–> <ItemGroup> <FrameworkReference Include=”Microsoft.AspNetCore.App” /> </ItemGroup> <!–… rest of file–> </Project>
There is no -IgnoreChanges currently in EF Core (see here) but you can achieve the equivalent by commenting out all the code in the Up() method and applying the migration. This will take a snapshot of the current model state so that subsequent migrations will only include changes from that point forward. So if you … Read more
You are setting “arabic” as DefaultRequestCulture but DefaultRequestCulture is used if none of the built-in providers can determine the request culture. The default providers are: QueryStringRequestCultureProvider CookieRequestCultureProvider AcceptLanguageHeaderRequestCultureProvider Most likely the culture is determined from the Accept-Language HTTP header that the browser is sending. You have to remove the AcceptLanguageHeaderRequestCultureProvider in order to fallback to … Read more
Solved with a custom formatter. Thank you Panagiotis for the suggestion. public class DateTimeConverter : JsonConverter<DateTime> { public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { Debug.Assert(typeToConvert == typeof(DateTime)); return DateTime.Parse(reader.GetString()); } public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options) { writer.WriteStringValue(value.ToUniversalTime().ToString(“yyyy’-‘MM’-‘dd’T’HH’:’mm’:’ssZ”)); } } // in the ConfigureServices() services.AddControllers() .AddJsonOptions(options => { … Read more
You should be able to retrieve a claims like this within your controller var identity = HttpContext.User.Identity as ClaimsIdentity; if (identity != null) { IEnumerable<Claim> claims = identity.Claims; // or identity.FindFirst(“ClaimName”).Value; } If you wanted, you could write extension methods for the IPrincipal interface and retrieve claims using the code above, then retrieve them using … Read more
.NET 6 is not supported in VS2019. You might make it work by manually editing your project file, but for a fully supported experience you should upgrade to VS2022.
As opposed to saving the data as a string (which allocates more memory than needed and might not work if the binary data has null bytes in it), I would recommend an approach more like foreach (var file in files) { if (file.Length > 0) { using (var ms = new MemoryStream()) { file.CopyTo(ms); var … Read more
You need to use the same user data model in SignInManager, UserManager and services.AddIdentity. Same principal is true if you are using your own custom application role model class. So, change services.AddIdentity<IdentityUser, IdentityRole>(options => { options.User.RequireUniqueEmail = false; }) .AddEntityFrameworkStores<Providers.Database.EFProvider.DataContext>() .AddDefaultTokenProviders(); to services.AddIdentity<Automobile.Models.Account, IdentityRole>(options => { options.User.RequireUniqueEmail = false; }) .AddEntityFrameworkStores<Providers.Database.EFProvider.DataContext>() .AddDefaultTokenProviders();