开发者

TFS and referenced DLLs

开发者 https://www.devze.com 2023-01-20 16:46 出处:网络
We are using TFS and VS 2010. I have been working on a project that is using TFS as source control. I have quite a few dlls that I have downloaded (such as log4net) and referenced in my project.

We are using TFS and VS 2010.

I have been working on a project that is using TFS as source control. I have quite a few dlls that I have downloaded (such as log4net) and referenced in my project.

When a new programmer connected to TFS and got my project out of source control, it failed to build as it said it was missing all these referenced dlls.

What did I do wrong here? How can I include those referenced DLLs in source control. Do I need t开发者_如何学Pythono add all these dlls to my project before referencing them? when I referenced them, I just browsed to where they were on my file system.


I've found the best practice for 3rd party DLLs is to create a "Library" folder in your sln/proj file structure and copy all the necessary DLLs into this local folder for reference. You'll also want to make sure these DLLs are checked into source control. This way, everyone who works on the project gets the exact same versions of all DLLs, and the reference paths are exactly the same.

Referencing 3rd party libs in a arbitrary download or install location will be problematic, because it will require all developers to maintain the same download structure for all DLLs. Also, if everyone references DLLs outside of the project structure, it's harder to guarantee that everyone's on the same version.

The other option would be to have everyone install the DLLs into the GAC, but that can be a real pain too, especially with version management and deployment.


I created a "ThirdPartyDLL" folder in my project folder in which I copied all the extra DLLs into it. I then went into source explorer and added those DLLs into the team foundation server so I could be sure I'm using the correct versions of the DLLS for specific versions of my application (and so everyone else is on the exact same page as I am).

View - other windows - Source coontrol explorer Right click project folder - add items to folder

You won't be able to select a specific folder with DLLs in it, but instead you can select the individual DLL files within the folder. You will then see the "ThirdPartyDLL" folder appear in that window.

Once this is done, those dlls are in the team foundation source control. Whenever a dev checks in, they will get the most current version of the DLLs.

Don't forget to remove the old references in your app and change them to your thirdpartydll folder.

I used to copy the DLLs into the bin folder but the issue I ran into was when the DLLs got upgraded. Initially when my project was small it wasn't a big deal. Now that I have multiple DLLs and applications that I created it became very difficult to maintain consistent versions of DLLs outside my project. My best example is the licensing dll I purchased. When this got upgraded all applications and libraries needed to be on the same version. If I forgot one then I had weird issues or the application just stopped working. Now that I have everything in one folder, I make the change once and everything is upgraded.

Hope this helps.


Andy's suggestion is a good one and I've used that in the past. At my current job, we have a "reference" folder on a network share for all of us to build from. We have a very fast network here, though and all developers are in a single office. This solution won't work as well if you have a lot of remote developers or a slow network.


I've tried various methods for dealing with this and have settled on dropping required dll's in the bin folder and making sure they are included in the project for source control. I've heard people say this might not be a good idea but nobody has provided good reasoning for it and it's worked well for me.

My second choice would be to carve out some space on a network share and organize the various 3rd party dll's there. You can put your files in folders with verion numbers to keep things straight and everyone should have access to everything they need, so long as everyone uses the normal network paths as a reference.

Adding a seperate folder within the project is also workable but seems messy, since you end up with extra files that you don't want included in your release.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号