美文网首页
DotNet Core Web API 项目搭建和部署

DotNet Core Web API 项目搭建和部署

作者: JADDC | 来源:发表于2018-11-27 14:46 被阅读0次
数据库连接字符串

在文件appsettings.json中添加连接字符串

    "ConnectionStrings": {
      "TestDB": "Server=.;Database=Crm;user id=test;password=123;Trusted_Connection=True;MultipleActiveResultSets=true;",
      "DefaultConnection": "Server=.;Database=CoreDB;Trusted_Connection=True;MultipleActiveResultSets=true"
    },
将程序部署到Windows server

1、在安装完IIS后,安装.net core window server hosting(runtime)
2、重启IIS iisreset
3、如果不重启IIS、runtime 版本不同 则可能会出现错误:HTTP Error 502.5 - Process Failure

Net Core runtime 下载地址:https://www.microsoft.com/net/download/archives
官网参考地址:https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/index?tabs=aspnetcore2x&view=aspnetcore-2.1

相关文章

网友评论

      本文标题:DotNet Core Web API 项目搭建和部署

      本文链接:https://www.haomeiwen.com/subject/vbowqqtx.html