ASPNetCore 发布到IIS

  1. 准备工作

1.1.  安装IIS。(具体操作不再说明)

安装成功后再浏览器输入localhost得到的页面如下

 ASPNetCore 发布到IIS

 

 

1.2.  安装dotnet-hosting-2.2.2-win.exe安装成功后在IIS

 ASPNetCore 发布到IIS

 

 

中可以看到如下两个程序

 ASPNetCore 发布到IIS

 

 

这两个程序对应得NetCore的版本不一样。一定要注意,因为NetCore现在的向下兼容不好,如果版本不对是不能成功发布的。比如我的电脑上是装的3.1的NetCore所以发布的版本必须是3.1。

2.开始发布

VS中的发布方式与普通的Web项目的发布方式相同

 ASPNetCore 发布到IIS

 

 

3.注意事项

3.1.  如何判断安装的NetCore的版本

 ASPNetCore 发布到IIS

 

 

3.2.  使用VS开发的时候,目标框架必须与电脑上安装的NetCore的版本一致,否则会报错,错误如下

 ASPNetCore 发布到IIS

 

 

3.3.  处理程序“aspNetCore”在其模块列表中有一个错误模块“AspNetCoreModuleV2”错误的解决方法,安装dotnet-hosting-2.2.2-win.exe即可

3.4.  NetCore网站的应用程序池比如按照如下配置

 ASPNetCore 发布到IIS

 

 

发布成功后访问我们的网站

 ASPNetCore 发布到IIS

 

相关文章:

  • 2022-01-08
  • 2021-12-09
  • 2021-12-07
  • 2021-12-20
  • 2021-09-03
  • 2021-05-23
  • 2021-10-13
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-18
  • 2021-10-16
  • 2022-12-23
  • 2022-12-23
  • 2022-02-14
  • 2021-07-10
相关资源
相似解决方案