using System; using System.Configuration; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; namespace Win.Sfs.SettleAccount { public class Startup { public void ConfigureServices(IServiceCollection services) { services.AddApplication(); services.Configure(options => { // Set the limit to 256 MB options.Limits.MaxRequestBodySize = 268435456; }); //上传文件大小限制IIS设置 services.Configure(options => { options.MaxRequestBodySize = 268435456; options.AllowSynchronousIO = true; }); } public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) { app.InitializeApplication(); } } }