Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Keep visual studio from deleting everything from bin/ on rebuild?

I have a web application project. I have DLLs that I reference in the project stored in my bin/ folder. Well, whenever I do a rebuild or clean from Visual Studio, it will delete everything in that folder. How do I prevent this from happening?

like image 238
Earlz Avatar asked Feb 01 '10 20:02

Earlz


2 Answers

I'll stay away from asking the 'why' question and just state the how. Mark the files as read only and VS shouldn't delete them.

like image 67
billb Avatar answered Oct 04 '22 02:10

billb


Do not put anything into bin yourself. bin is the target folder for binaries - it is not a source folder for binaries.

Create yourself a lib folder or something like that to put your third-party binaries into. You might even name it "Third Party Binaries", since not everyone knows that "lib" means the same thing. Make your references to the binaries in this folder, and Visual Studio will copy them into bin when necessary (including on a rebuild).

like image 23
John Saunders Avatar answered Oct 04 '22 01:10

John Saunders