小编Muh*_*eem的帖子

ASP.NET Core 3.0中HttpRequest.EnableRewind()的替代方法是什么?

BufferingHelper.EnableRewind();
Run Code Online (Sandbox Code Playgroud)

上面是ASP.NET Core 2.2中HttpRequest对象的扩展方法。ASP.NET Core 3.0(至少具有此名称)中没有更多内容。我想知道它在ASP.NET Core 3.0中是备用的。我不确定

HttpRequestRewindExtensions.EnableBuffering();
Run Code Online (Sandbox Code Playgroud)

是替代者。

buffering httprequest alternate asp.net-core-3.0

12
推荐指数
1
解决办法
1656
查看次数

将项目从.net Core 2.2迁移到3.0 Preview-7后,Swagger无法正常工作(引发异常)

我刚刚将项目从.net core 2.2迁移到3.0 Preview7。我在其中使用Swashbuckle.AspNetCore(v4.0.1)。这是我的入门班。

public class Startup
    {
public IConfiguration Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {

            services.AddDbContext<ApplicationDbContext>(options =>
                                                            options.UseSqlServer(
                                                            Configuration["ConnectionStrings:ConnectionStringAzureSQL"]));

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_3_0);


            services.AddApplicationInsightsTelemetry();

            services.AddLocalization(options => options.ResourcesPath = @"Resources");

            services.AddMemoryCache();

            services.Configure<RequestLocalizationOptions>(options =>
            {
                var supportedCultures = new List<CultureInfo>
                    {
                        new CultureInfo("en-US")
                    };

                options.DefaultRequestCulture = new RequestCulture("en-US");
                options.SupportedCultures = supportedCultures;
                options.SupportedUICultures = supportedCultures;
            });

            services.AddSwaggerGen(c =>
            {

                c.SwaggerDoc("v1", new Info { Title = …
Run Code Online (Sandbox Code Playgroud)

exception swagger swashbuckle asp.net-core-webapi

7
推荐指数
1
解决办法
1944
查看次数