How to force nuget package reference dlls to be copied to output directory?
Asked Answered
M

1

9

I added the System.Memory Nuget Package to my net48 Azure Function V1 project to provide the missing dlls for a referenced netstandard2.0 package. But as the package is not directly used in my code, the dlls are not copied to the output folder.

How can I force the dlls of the System.Memory package to be copied to the output folder on build? I already tried with <IncludeAssets>all</IncludeAssets> but this only copies the dlls to output folder in some cases (e. g. rebuild project). But if I run the Azure Function debugger, the dlls are getting deleted again from output folder.

Copy local does not exist for package references: Copy local does not exist for package references

Maniemanifest answered 17/11, 2021 at 12:23 Comment(2)
Are you just building your project, or also publishing?Contrapuntist
The Azure Function will also get publishedManiemanifest
U
3

This works for me: <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

Explanation: https://www.koskila.net/how-to-copy-dependent-assemblies-to-bin-folder-on-build/

Unbonnet answered 31/8, 2022 at 6:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.