Satyajit
Satyajit

Reputation: 2071

Why does .NET Core not add the reference Dlls from the nuget packages to the bin folder

.Net Core projects do not put the reference DLLs from the nuget packages in the bin folder. Is there a way of any properties that helps in doing that? It's needed for some third party tools to understand the reference DLLs.

Upvotes: 4

Views: 2962

Answers (1)

natemcmaster
natemcmaster

Reputation: 26773

.NET Core, unlike .NET Framework, can resolve assemblies from half a dozen locations. This includes the NuGet cache, servicing cache, runtime store, local app directory, and shared framework folder. During development, these are typically found in the NuGet cache (%USERPROFILE%.NuGet\packages) This makes it unnecessary to copy referenced assemblies to the build output folder (bin) until you publish your application. For more details on how that works, see https://github.com/dotnet/core-setup/blob/master/Documentation/design-docs/corehost.md

You can force the SDK to copy assemblies to your build folder by setting the proper below, but it increase disk use and build time.

<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

Or you can use the deps.json and runtimeconfig.json file to locate required assemblies.

Upvotes: 6

Related Questions