ABP .Net Core 后台程序发布至IIS(6)

 

 

一、选择“Web.Host”, 点击右键,进行发布

ABP .Net Core 后台程序发布至IIS(6)_第1张图片

 

ABP .Net Core 后台程序发布至IIS(6)_第2张图片

 

二,配置发布选项,选择“文件系统”,选择发布目录

ABP .Net Core 后台程序发布至IIS(6)_第3张图片

    

   三、  配置完后点击发布,如下图:

ABP .Net Core 后台程序发布至IIS(6)_第4张图片

 输出工具输出发布信息

ABP .Net Core 后台程序发布至IIS(6)_第5张图片

 

四、IIS中查看模块中包含AspNetCoreModule

ABP 如果使用时Net Core 跨平台,它依赖AspNetCoreModule模块

ABP .Net Core 后台程序发布至IIS(6)_第6张图片

ABP .Net Core 后台程序发布至IIS(6)_第7张图片

 当模块中不包含AspNetCoreModule,需要下载安装,下载地址:https://dotnet.microsoft.com/download

ABP .Net Core 后台程序发布至IIS(6)_第8张图片

 

四、IIS中新建站点

ABP .Net Core 后台程序发布至IIS(6)_第9张图片

说明:http://192.168.8.22:1001   访问地址

浏览器输入地址(http://192.168.8.22:1001)进行访问, 自动可跳转至http://192.168.8.22:1001/swagger/index.html

 

五、出现跨域异常cross-origin

ABP .Net Core 后台程序发布至IIS(6)_第10张图片

 

六、修改appsettings中配置

打开发布目录可发现有多个配置文件:appsettings.json   appsettings.production.json   appsettings.Staging.json

代码读取哪一个appsettings是有环境变量配置的,此时为发布环境,读取的是appsettings.production.json

打开appsettings.production.json修改配置即可

(1)数据库连接:

       说明:Server=localhost; Database=PDDb; Trusted_Connection=True;

             Trusted_Connection=yes(可信任连接)  ,password设不设密码都能访问(安全性低)

"Default": "Server=.; Database=PDDb; User=sa; Password=1;Trusted_Connection=false;"

(2)ServerRootAddress( 步骤四中,配置的地址):

"ServerRootAddress": "http://192.168.8.22:1001/"

 

ABP .Net Core 后台程序发布至IIS(6)_第11张图片

 

七、上一步修改完后并保存后,重新启动

ABP .Net Core 后台程序发布至IIS(6)_第12张图片

 

八、重新访问地址http://192.168.8.22:1001 ,此时已经访问正常。

ABP .Net Core 后台程序发布至IIS(6)_第13张图片

 

 

你可能感兴趣的:(ABP ,.Net,Core,后台程序发布至IIS,ABP框架学习日记)