i am using some libraries and i added a reference to that library dll and i set the "Copy Local" to true.
but i want to change the location of the dll to be a subfolder in the exe folder and not with the exe.
how is this possible?
thanks
Update:
i used the following Post-build event [as Jon Skeet recommended]
move /y $(TargetDir)\System.Data.SqlServerCe.dll $(TargetDir)\Lib\SqlSrvCe\System.Data.SqlServerCe.dll
Do you need it as a reference? Or is the reference only to copy the dll to the desired location?
If you do not need the reference, try adding it to the project and setting it to always copy.
Add the dll to a folder in the project and set to Copy to Output Directory http://web11.twitpic.com/img/146848312-ecfdeadf5b322fe755c7a764d6e6dbf0.4c69c2f0-full.png
I don't know whether it's feasible within "normal" build rules, but you could add post-build steps which basically moved the files. It would be ugly, but it should work.
You'll need a .config file for your .exe so that the probing path is changed. A subdirectory is no problem, just use the
<probing>
element, its privatePath attribute is a relative folder name.Beware however that you'll get little help from the IDE to put the DLL in that spot. You'll need a post build event that creates the folder if necessary and xcopy's the DLL there. Something like this: