.NET - 正确部署和发布

时间:2018-06-18 01:26:00

标签: c# asp.net-core ubuntu-16.04

我尝试将我的.NET核心Web应用+ React应用程序(由Visual Studio 2017生成)部署到Ubuntu服务器。 我做了什么

  • 将项目的repo克隆到~/projects/doggy
  • 已执行dotnet restore
  • 安装并配置了Nginx反向代理
  • 执行dotnet run我可以看到我的网站

但是,我不想将源代码和二进制文件放在同一个文件夹中,所以我做了

  • 创建了另一个文件夹~/sites/doggy
  • 在我执行~/projects/doggy
  • 的文件夹dotnet publish -c Release -o ~/sites/doggy/
  • 转到文件夹~/sites/doggy并执行dotnet doggy.dll

这是一个很大的kaboom。 我收到了这个错误

Error: An assembly specified in the application dependencies manifest (squeegeez.deps.json) was not found: package: 'Microsoft.AspNetCore.Antiforgery', version: '2.0.3' path: 'lib/netstandard2.0/Microsoft.AspNetCore.Antiforgery.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.8.xml

为什么publish命令无法复制所有需要的程序集?如何正确地做到这一点?

我找不到一个适当的教程,源代码独立于部署的位置?有什么建议?

0 个答案:

没有答案