user1688401
user1688401

Reputation: 1871

.net core 2.0 does not publish nuget dll

In .net core 2.0 I add some nuget package.Project work in local but does not work in server-production.I click solution and click publih to folder and move that folder to server.But in published folder there is no this nuget dll how can I publish that nuget dll?In that folder I didnt find that dll C:\Users\HC.nuget\packages

enter image description here

Upvotes: 0

Views: 707

Answers (1)

Pace
Pace

Reputation: 43817

I think the problem is all of those packages are included in the ASP.NET Core Implicit Store. These are only present however, if the SDK is present on the target machine. If this is the case you have 3 options.

  1. Install the .NET Core SDK (not just the runtime) on the target machine. In this case the implicit store will be present.
  2. Set the following property to false: <PropertyGroup> <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest> </PropertyGroup> This will cause the build to include dependencies that are in the implicit store so that the final published product only relies on the .NET Core Runtime and not the API.

  3. Build a self-contained deployment

    This will bundle everything (runtime and implicit dependencies) into your application.

Upvotes: 2

Related Questions