第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么我只在紅隼上得到 500?

為什么我只在紅隼上得到 500?

C#
撒科打諢 2022-11-22 15:10:28
我有一個ASP.NET Core 2.0 WEB-API,它應(yīng)該可以在kestrel上運(yùn)行,因?yàn)樗鼘⒃谀抢锿泄堋.?dāng)我開始使用 Kestrel(查看下面的 launchSettings)時,有一個 POST,我總是得到500 返回,而無需進(jìn)入代碼。意味著我到處都留下了斷點(diǎn),當(dāng)我在 Swagger 中執(zhí)行 POST 時,沒有斷點(diǎn)被擊中。當(dāng)我改用 IIS 時,它工作正常。500 馬上就來了。500 也是在 Linux Kestrel 上部署后出現(xiàn)的。我實(shí)現(xiàn)@Startup.cs:    public void Configure(IApplicationBuilder app, IHostingEnvironment env)    {        app.Use((context, next) =>        {            context.Response.Headers.Remove("Server");            return next();        });@程序.cs:    public static IWebHost BuildWebHost(string[] args) =>        WebHost.CreateDefaultBuilder(args)            .UseStartup<Startup>()            .UseUrls("http://0.0.0.0:5000")            .UseIISIntegration()            .UseApplicationInsights()            .UseKestrel()            .Build();@launchSettings.json:"Kestrel": {  "commandName": "Project",  "launchBrowser": true,  "launchUrl": "",  "environmentVariables": {    "ASPNETCORE_ENVIRONMENT": "Development"  }}使用 Kestrel,POST 調(diào)用應(yīng)該使用與 IIS 相同的所有邏輯來處理 Controller 方法。
查看完整描述

1 回答

?
慕的地10843

TA貢獻(xiàn)1785條經(jīng)驗(yàn) 獲得超8個贊

我得到它的工作


    public static IWebHost BuildWebHost(string[] args) =>

        WebHost.CreateDefaultBuilder(args)

            .UseStartup<Startup>()

            .UseIISIntegration()

            .UseApplicationInsights()

            .UseKestrel(options =>

            {

                options.Listen(IPAddress.Parse("0.0.0.0"), 5000);

            })

            .Build();

和啟動設(shè)置:


    "CZKestrel": {

  "commandName": "Project",

  "launchBrowser": true,

  "environmentVariables": {

    "ASPNETCORE_ENVIRONMENT": "Development"

  },

  "applicationUrl": "http://localhost:59883/"

}

用于本地調(diào)試。


為了讓它作為服務(wù)工作,我做了 dotnet restore 和 dotnet build,我只將帶有創(chuàng)建的 dll 的文件夾復(fù)制到另一個地方,而不是運(yùn)行/啟動服務(wù)。我想當(dāng)我啟動它時,我應(yīng)該在里面或 dll 文件夾上面的一個文件夾?,F(xiàn)在可以了。


查看完整回答
反對 回復(fù) 2022-11-22
  • 1 回答
  • 0 關(guān)注
  • 102 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號