Strawberry Farmer
Strawberry Farmer

Reputation: 892

Is it ok to put stuff in your bin folders?

Ok, so, I am directing this question towards Visual Studio IDE's on iis, .NET, MVC, but all types of answers are fine.

Questions:

Q1. Is it ok to put .ddl's that your project is complaining for into your debug and release bins?

Q2. Is it only okay to do the above(Q1.) if you have tried to Clean your solution first?

Q3. What are the rules when it comes to the bin folder?

Upvotes: 1

Views: 1064

Answers (3)

Gjohn
Gjohn

Reputation: 1281

No would be my answer. Mainly because I hate checking the bin folder into version control. Put your dll's into an External folder and reference it from there. Better yet, setup your own nuget server and host your dll's on there or use one of the available services that allow you to host your nuget packages.

Upvotes: 1

Kritner
Kritner

Reputation: 13765

I prefer not to add required dlls in the bin folder for a few reasons:

  1. I seem to recall bin folder being cleared in a clean (i think that's accurate)
  2. When a project relies on an external dll being in the bin folder, then that means the bin folder needs to be checked into source control. The bin folder is omitted from source control by default (with TFS anyway) so it throws me off when a bin folder is checked in, and every dll that changes is then source controlled itself.

My preferred solution is to use nuget for external resources, but if that's not possible, adding a separate folder for external dlls (i usually call it extLib) and have that folder and its contents checked in.

Upvotes: 1

BradleyDotNET
BradleyDotNET

Reputation: 61349

Yes put whatever you like into your bin folders, it won't hurt anything.

That being said, in an ideal world your project will run correctly without manually copying files to the bin folder, so if you can add the required files to your project and set them to "Copy Always" so they show up automatically, its a better option.

Otherwise, if you delete the bin folder (pretty common practice to get a truly "clean" bin) you have to remember to copy the extra files back in. Do this enough, and its really annoying.

Upvotes: 1

Related Questions