I want to copy my dll generated in bin folder to a file location on Post Build Event in vs2010.
Can some one help me on that.
Thanks
Add the file to your project, then in the file properties select under "Copy to Output Directory" either "Copy Always" or "Copy if Newer".
"Copy to Output Directory" is the property of the files within a Visual Studio project, which defines if the file will be copied to the project's built path as it is. Coping the file as it is allows us to use relative path to files within the project.
In the Post-build event command line box, specify the syntax of the build event. Add a call statement before all post-build commands that run . bat files. For example, call C:\MyFile.
You want to add something like:
xcopy /Q /Y "$(TargetPath)" "C:\path\to\somewhere\"
to you post-build event on the Build Events tab in the project properties page. The /Y
will stop it from prompting you to confirm an overwrite.
If you also need to copy the .pdb
file, you will need something like this:
xcopy /Q /Y "$(TargetDir)$(TargetName).*" "C:\path\to\somewhere\"
You can see more substitution tokens (the $XXX values) by clicking the Edit Post-build... button in the properties tab and then expanding the Macros>> button.
Right-click the project, then go to Properties->Build Events->Post-build command line.
Then type this in:
Cmd /C Copy "$(TargetPath)" "<YourTargetDirHere>"
Does that help?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With