Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all,

I am trying to find out is it possible to having a another copy of the DLL of the project saved into another path?

To make it clear: I have a class library project and when I build the project in Release mode, I have a DLL saved under the Bin\Release folder.
Ex path: "C:\Users\username\Documents\Visual Studio 2012\Projects\ProjectName\bin\Release"

I am looking to find out when I build the project I want it to place DLL in a different path as well. Let's say a DLL in both following paths:
- "C:\Users\username\Documents\Visual Studio 2012\Projects\ProjectName\bin\Release"
- "C:\Users\username\Programs\DLLS\"

Is this possible? If so can you give me a link where it explains how to do it? Thanks in advance.

=EDIT=

I have now checked the project's properties. Under Build Events I have a place "Post build event command line": I have the following code:
if /I "$(ConfigurationName)" == "Release" Eazfuscator.NET.exe "$(TargetPath)" --msbuild-project-path "$(ProjectPath)" --msbuild-project-configuration "$(ConfigurationName)" --msbuild-project-platform "$(PlatformName)" --msbuild-solution-path "$(SolutionPath)" -n --newline-flush -v 3.3

I am using Eazfuscator.Net for obfuscation I think it manually added this code. Seems like if I need to add a new path I think I need to use Post-Build event command line. Maybe adding the path here by a command line? If this the right way:
- Can I add another line of code without messing the obfuscation line or do I have to change the already existing line which I wrote?
Posted
Updated 31-Oct-13 22:39pm
v2

1 solution

Add a post-build step (can be found under project properties in the Build Events section).
You have access to environment variables using %% and also project/solution specific macros.

Something like this might work for you:
copy $(TargetPath) %USERPROFILE%\Programs\DLLS\

Hope this helps,
Fredrik
 
Share this answer
 
Comments
wonder-FOOL 1-Nov-13 4:45am    
I have just updated my question. I have already have a post-build event there. Does it allow me to put multiple lines of code? Or should I rewrite the existing one? Thank you very much for the answer.
Fredrik Bornander 1-Nov-13 4:52am    
You can add any number of lines and they'll be executed sequentially.
For really complex post-build scripts you can use a .bat file or a powershell script that you call form the post-build event.
wonder-FOOL 1-Nov-13 5:16am    
Thank you.
Fredrik Bornander 1-Nov-13 5:22am    
Glad I could help.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900