我尝试将我的.NET核心Web应用+ React应用程序(由Visual Studio 2017
生成)部署到Ubuntu服务器。
我做了什么
~/projects/doggy
dotnet restore
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
命令无法复制所有需要的程序集?如何正确地做到这一点?
我找不到一个适当的教程,源代码独立于部署的位置?有什么建议?