I have a .NET Core class library project ClassLibrary1
created in Visual Studio 2015. In this class library project, I added a folder NewFolder
that will be used by whichever project is referencing ClassLibrary1
.
So for instance, I have a project called ConsoleApplication1
that references ClassLibrary1
. Every time I build ConsoleApplication1
, NewFolder
should be copied
FROM
PROJECT_PATH\ClassLibrary1\bin\Debug\net452\win7-x64\NewFolder
TO
PROJECT_PATH\ConsoleApplication1\bin\Debug\net452\win7-x64\NewFolder
UPDATE:
I added the following to the project.json
file of my ClassLibrary1
project.
"buildOptions: {
"copyToOuput": "NewFolder"
}"
It only copies the the folder to PROJECT_PATH\ClassLibrary1\bin\Debug\net452\win7-x64\NewFolder
but not to PROJECT_PATH\ConsoleApplication1\bin\Debug\net452\win7-x64\NewFolder
every time I build ConsoleApplication1
.
I have no idea how this should be done in .NET Core projects because this does not seem to be the behaviour for non .NET Core projects.
UPDATE 2:
In non .NET Core projects I simply add a script to the post-build events command line of ClassLibrary1
and it automagically copies everything in the ClassLibrary1/bin/Debug
including files and folders to ConsoleApplication1/bin/Debug
.
xcopy "$(ProjectDir)NewFolder" "$(TargetDir)NewFolder" /E /Y