2

I have two C# projects. One is MainProject(exe) and other is ModuleProject (dll). What I want is that when I build my Moudule project, a copy of its output dll is copied to MainProject output folder. If I am building project in debug then it should go to debug folder.

I guess we can achieve this using build events, but I am not familiarized with them. Can anyone tell me exact command what should I write there, or any other solution.

fhnaseer
  • 7,159
  • 16
  • 60
  • 112

1 Answers1

1

use this link to learn about the post build:

use $(OutDir) to get to the output directory or $(TargetFileName) for the dll name. copy it using the copy command like in command line

it should be something like this:

copy /Y "$(TargetDir)$(ProjectName).dll" "$(SolutionDir)lib\$(ProjectName).dll"

or something like:

copy /Y "$(TargetDir)$(ProjectName).dll" "d:\\MainProject\\bin\\debug\\$(ProjectName).dll"
No Idea For Name
  • 11,411
  • 10
  • 42
  • 70