惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

小众软件
小众软件
B
Blog RSS Feed
美团技术团队
博客园 - 【当耐特】
C
Check Point Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
M
MIT News - Artificial intelligence
aimingoo的专栏
aimingoo的专栏
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 司徒正美
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
Google DeepMind News
Google DeepMind News
D
DataBreaches.Net
人人都是产品经理
人人都是产品经理
N
Netflix TechBlog - Medium
Vercel News
Vercel News
P
Proofpoint News Feed
IT之家
IT之家
I
InfoQ
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More

博客园 - baileyer

VisualSVN破解安装到VS2026 使用 SQL 中的递归查询(Recursive CTE)来实现1-50数字 git 忽略本地文件提交(VS) C# 自定义导出模板(NPOI) Abp vue项目找不到模块“./app.vue” MSSqlserver分割文件备份恢复 github的镜像下载加快clone下载速度 .net core/mvc获取特性 oracle instr 替代like查询 quartz3.0.7和topshelf4.2.1实现任务调度 VS2017同时生成.net core和.net framework两份代码 .net core Failed to load API definition 错误 vs 2017 调试中断问题 .net Core 2.2实现京东宙斯API采用OAuth授权方式调用 WinForm 校验只能输入数字英文字母退格键 NPOI导出excel C#通过反射获取相应的字段和值 activemq.bat 在window7 x64下启动(安装)报错解决方案 <asp:RadioButton> 选项判断
widows部署.NET Core 3.1项目到IIS问题
baileyer · 2021-01-16 · via 博客园 - baileyer

  最近在部署.net core 3.1的项目到iis,遇到了一些问题,找了很多资料,然后通过一一实践,也就 顺利完成了部署。也因此总结记录下来,希望可以帮助到更多的人。

  感谢文献参考:Windows平台部署 Asp.Net Core 3.1.0,将 ASP.NET Core 应用发布到 IIS ,使用 IIS 在 Windows 上托管 ASP.NET Core

  1.首先安装SDK(我安装的是:dotnet-sdk-3.1.100-win-x64.exe)地址:https://dotnet.microsoft.com/download

  2.安装.NET Core Hosting Bundle(我安装的版本是:dotnet-hosting-3.1.2-win.exe) 地址:https://dotnet.microsoft.com/download/dotnet-core/3.1

  3.部署iis,绑定IP端口号,修改应用程序池托管方式

  

  4.运行程序发生错误

  a . HTTP Error 500.30 - ANCM In-Process Start Failure

  b. System.InvalidOperationException: Application is running inside IIS process but is not configured to use IIS server.

  c. Application '/LM/W3SVC/11/ROOT' with physical root 'D:\测试\XXXXXX-01\' hit unexpected managed exception, exception code = '0xe0434352'. First 30KB characters of captured stdout and stderr logs

  d.  System.InvalidOperationException: Synchronous operations are disallowed. Call WriteAsync or set AllowSynchronousIO to true instead.

  5.解决方式

   4-a. HTTP Error 500.30 - ANCM In-Process Start Failure

    解决方式:

        ①.停止iis  ,打开:C:\Windows\System32\inetsrv\config\applicationHost.config ,搜索节点AspNetCoreModuleV2 

          ②.修改节点指定加载模式  preCondition="bitness64"

<add name="AspNetCoreModuleV2" image="%ProgramFiles%\IIS\Asp.Net Core Module\V2\aspnetcorev2.dll" preCondition="bitness64" />

<add name="AspNetCoreModuleV2" preCondition="bitness64" />

   4- b. System.InvalidOperationException: Application is running inside IIS process but is not configured to use IIS server.

      4- c.  Application '/LM/W3SVC/11/ROOT' with physical root 'D:\测试\XXXXXX-01\' hit unexpected managed exception, exception code = '0xe0434352'. First 30KB characters of captured stdout and stderr logs:

    解决方式:在program.cs中删除:webBuilder.UseKestrel();

 public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.UseStartup<Startup>();
                    //webBuilder.UseKestrel();
                })


    }

  4-d .System.InvalidOperationException: Synchronous operations are disallowed. Call WriteAsync or set AllowSynchronousIO to true instead.

  解决方式:在startup.cs 中的ConfigureServices方法加入以下代码

public void ConfigureServices(IServiceCollection services)
{
    // If using Kestrel:
    services.Configure<KestrelServerOptions>(options =>
    {
        options.AllowSynchronousIO = true;
    });

    // If using IIS:
    services.Configure<IISServerOptions>(options =>
    {
        options.AllowSynchronousIO = true;
    });
}