简体   繁体   中英

Can Visual Studio compile project references into a different folder then the main .exe

I have a WPF Application project with several project references within a single solution in VS 2008. When I compile my solution, all of the referenced dlls are output into the same folder that the main .exe is output into.

Is it possible to configure my main .exe project build to output all references in a sub folder relative to my .exe?

I would like the final result to be something like this:

MyApp.exe MyApp.exe.config Lib\\SomeReference.dll Lib\\SomeReference2.dll

(I assume if this is possible, it would be possible with any .exe).

Thanks! Jon

It looks like its a fairly intensive process.

First set the reference's Copy Local property to false so that the .dlls aren't copied to the bin\\Debug folder .

Then create an assemblyBinding\\probing element in your app.config to instruct the runtime to look for dlls in the Lib folder

Then create a post-build action to copy the necessary dlls to the \\bin\\Debug\\Lib folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM