部署dotnet Core Web API
上一步的文章,是我们公司最核心的一个ORM组件,在中标麒麟系统完成了一个插入数据的任务,这一步是将正式的从dot net framework 迁移到 dotnet core 的项目,部署运行在中标麒麟系统中。
项目预览
现有从dotnet framework 迁移过来的一个 dotnet core web api 项目,准备部署中标麒麟系统上测试运行,下面是项目截图:
运行 & 解决
将文件上传到服务器上,然后执行命令运行:
[root@gumis02 API]# dotnet Beyondbit.One.BUA.API.dll
Error:
An assembly specified in the application dependencies manifest (Beyondbit.One.BUA.API.deps.json) was not found:
package: 'Microsoft.ApplicationInsights.AspNetCore', version: '2.1.1'
path: 'lib/netstandard1.6/Microsoft.ApplicationInsights.AspNetCore.dll'
This assembly was expected to be in the local runtime store as the application was published using the following target manifest files:
aspnetcore-store-2.0.0-linux-x64.xml;aspnetcore-store-2.0.0-osx-x64.xml;aspnetcore-store-2.0.0-win7-x64.xml;aspnetcore-store-2.0.0-win7-x86.xml
[root@gumis02 API]#
果不既然错误可能会迟到,但是绝不缺席,显示的错误是在开发过程中应用的nuget dll 找不到。这个问题是个小问题,已经有同学写了文章,Fix *.deps.json was not found,文章提到的解决办法:
增加如下一行到 csjproj文件中即可:false 最后csjproj文件看上去像这个样子:
netcoreapp2.0
false
重新发布项目,然后运行上面的问题已经解决,出现其他的问题:
[root@gumis02 API]# dotnet Beyondbit.One.BUA.API.dll
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
No XML encryptor configured. Key {0372b52e-5124-4655-871b-906a0467a642} may be