how to change the location that the references dlls are copied to?

后端 未结 3 560
挽巷
挽巷 2021-01-24 05:39

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

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-24 06:14

    You'll need a .config file for your .exe so that the probing path is changed. A subdirectory is no problem, just use the 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:

    if not exist "$(TargetDir)mumble" mkdir "$(TargetDir)mumble"
    xcopy /d /y "$(TargetDir)something.dll" "$(TargetDir)mumble"
    

提交回复
热议问题