.Net Core - Building to release does not copy NUGET dependencies

Leo*_*rdo 4 .net .net-core visual-studio-mac

I have a console .net core app.
It references a few nuget packages.
Now that it's ready to deploy, when i'm building to release, the nuget references are not coming along so i'm getting a bunch of file not found...

how can i fix this?

Oma*_*jid 10

这是建立(用于测试)和发布(用于部署到生产)之间的区别.dotnet build将构建您的应用程序以进行本地测试和使用.它将假设机器上存在nuget依赖性.如果要构建部署,请dotnet publish改为使用:

dotnet publish -c Release
Run Code Online (Sandbox Code Playgroud)

然后查看./bin/Release/netcoreapp2.0/publish目录.它应该包含所有依赖项.

有关详细信息,请参阅https://docs.microsoft.com/en-us/dotnet/core/deploying/deploy-with-cli.