2010-03-02 57 views
2

我的解決方案中有2個項目。第一個是控制檯應用程序,第二個是dll,由控制檯使用(引用)。當我構建我的解決方案(發佈)時,我得到一個EXE文件和一個DLL文件,因爲copy localtrue(如果我將它設置爲false,它不會運行)。在Visual Studio 2008 C中更改Dll文件夾#

如何將該DLL文件存儲在子目錄中?如果我的輸出文件夾是C:\123\,並且有EXE文件,我希望我的所有DLL都在C:\123\Dll\

+0

也許這可以幫助:http://stackoverflow.com/questions/1159192/howto-load-assemby-at-runtime-before-assemblyresolve-event – Oliver 2010-03-02 14:29:10

回答

3

您應該能夠使用probing element指定您的應用程序在嘗試解析dll依賴項時應該使用哪些路徑。

例子:

<configuration> 
    <runtime> 
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> 
     <probing privatePath="123;123\dill"/> 
     </assemblyBinding> 
    </runtime> 
</configuration> 

您也可以使用Post-build event command line到你的DLL複製到特定的目錄。

相關問題