Reputation: 440
A have a .NET Core project and i want to copy a specified NuGet reference (assembly.dll) to the build output because i'm using a dependency injection component that searches de bin folder for the types.
I know that i could use this, but it copies all the nugets when I only want a specific nuget package to be copied:
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
Upvotes: 0
Views: 180
Reputation: 745
Assuming you're using Visual Studio... Project->Properties->Build Events
"Put this in the Post-build event command line:" box
copy "$(SolutionDir)assembly.dll" "$(TargetDir)"
Or add this to your project file:
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="copy "$(SolutionDir)assembly.dll" "$(TargetDir)"" />
</Target>
Upvotes: 1