asp.net-core

.NET Core 128kb File size limit deployed to Azure App Service

岁酱吖の 提交于 2021-02-19 04:11:03
问题 I have a .NET Core 2.0 web app running on an Azure App Service instance. When I try to upload a file using file.CopyToAsync() , the upload fails with no diagnostic output if the file is larger than 128kB. Some photo types like png just get chopped at 128kB, even when they're several mB in size. When I try running locally, I can upload much larger files into my wwwroot/etc... folder on my local machine, so the problem seems specific to Azure App Services. I've looked up documentation on file

.NET Core 128kb File size limit deployed to Azure App Service

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-19 04:10:25
问题 I have a .NET Core 2.0 web app running on an Azure App Service instance. When I try to upload a file using file.CopyToAsync() , the upload fails with no diagnostic output if the file is larger than 128kB. Some photo types like png just get chopped at 128kB, even when they're several mB in size. When I try running locally, I can upload much larger files into my wwwroot/etc... folder on my local machine, so the problem seems specific to Azure App Services. I've looked up documentation on file

Different HTTP calls, await same Task

北慕城南 提交于 2021-02-19 03:14:17
问题 I have a Task which starts a win process, which generates file if its not created yet and returns it. The problem is that the action is called more than once. To be more precisely its src attribute of a <track> element. I have ConcurrentDictionary<Guid, Task<string>> which keeps track of for which Id a process is currently running public async Task<string> GenerateVTTFile(Guid Id) { if (_currentGenerators.TryGetValue(id, out Task<string> task)) { return await task; // problem is here? } var t

Different HTTP calls, await same Task

守給你的承諾、 提交于 2021-02-19 03:08:39
问题 I have a Task which starts a win process, which generates file if its not created yet and returns it. The problem is that the action is called more than once. To be more precisely its src attribute of a <track> element. I have ConcurrentDictionary<Guid, Task<string>> which keeps track of for which Id a process is currently running public async Task<string> GenerateVTTFile(Guid Id) { if (_currentGenerators.TryGetValue(id, out Task<string> task)) { return await task; // problem is here? } var t

Disable/Remove '?ReturnUrl=' from Url's in netcore 2

只愿长相守 提交于 2021-02-19 01:41:32
问题 I am trying to find a way to prevent my aspnetcore application to add "?ReturnUrl=" to the URL. Does anyone know how to do it, using some kind of middleware. I tried doing it like below but it did not have any effect: public class RequestHandlerMiddleware { private readonly RequestDelegate _next; public RequestHandlerMiddleware(RequestDelegate next) { _next = next; } public async Task Invoke(HttpContext context) { if(context.Request.QueryString.HasValue && context.Request.QueryString.Value

Dependency Injection with options pattern

此生再无相见时 提交于 2021-02-19 01:36:09
问题 I'm trying to load some settings from the appsettings file and I've got a small issue with the way lists are loaded when using the options pattern. Suppose I've got the following classes (for loading the settings): public class Application { public string Name { get; set; } = ""; public IEnumerable<string> Roles { get; set; } = new[] {""}; public Application ToApplicationWithoutPass() => new Application { Name = Name, Username = Username, Roles = Roles.ToList() }; } public class Applications

UserManager.FindAsync(username, password) not available in ASP.NET 5 / Identity 3

a 夏天 提交于 2021-02-19 01:16:53
问题 I'm trying to upgrade a project to ASP.NET 5 / MVC 6. The UserManager that came with AspNet.Identity used to have a FindAsync method where I could pass in a username and password. It doesn't seem to be there anymore. I don't think I need the SigninManager or Authentication as I'm using JWT Bearer Authentication. I just need to check the username and password are valid before I grant an access token, 回答1: Simply use UserManager.FindByNameAsync() to find the user object then check its password:

UserManager.FindAsync(username, password) not available in ASP.NET 5 / Identity 3

爷,独闯天下 提交于 2021-02-19 01:16:27
问题 I'm trying to upgrade a project to ASP.NET 5 / MVC 6. The UserManager that came with AspNet.Identity used to have a FindAsync method where I could pass in a username and password. It doesn't seem to be there anymore. I don't think I need the SigninManager or Authentication as I'm using JWT Bearer Authentication. I just need to check the username and password are valid before I grant an access token, 回答1: Simply use UserManager.FindByNameAsync() to find the user object then check its password:

UserManager.FindAsync(username, password) not available in ASP.NET 5 / Identity 3

匆匆过客 提交于 2021-02-19 01:16:23
问题 I'm trying to upgrade a project to ASP.NET 5 / MVC 6. The UserManager that came with AspNet.Identity used to have a FindAsync method where I could pass in a username and password. It doesn't seem to be there anymore. I don't think I need the SigninManager or Authentication as I'm using JWT Bearer Authentication. I just need to check the username and password are valid before I grant an access token, 回答1: Simply use UserManager.FindByNameAsync() to find the user object then check its password:

The antiforgery token could not be decrypted

谁都会走 提交于 2021-02-19 01:12:20
问题 I have an identity server asp net core project deployed in Azure, i also have two asp net 5 mvc client using my identity server as SSO, and continuously i am getting(save in logs) an exception The antiforgery token could not be decrypted . 回答1: We had similar issue today, We were able to resolve by persisting data protection keys to file system . services.AddDataProtection() .PersistKeysToFileSystem(new DirectoryInfo(@"\\UNC-PATH")); 回答2: We had the same error message Antiforgery token