Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
679 views
in Technique[技术] by (71.8m points)

visual studio 2010 - TFS dll and references issues

We use Team Foundation Server for our main project. Every time we add a new employee either onsite or offsite we always have to set up the references manually.

Is it possible for TFS to copy/save/pass the dll's to the new user without having to install them every time?

For example I add new functionality and install DocumentFormat.OpenXml to my project. Set up the code it runs and works fine on my machine, I publish it works just fine live. I check in everything into TFS.

My co worker downloads the project attempts to build it and it errors out saying it doesn't know what to do with DocumentFormat.OpenXml because no reference exist.

So they they must download DocumentFormat.OpenXml and then they can build and run the project.

Is there a way for TFS to save us this step?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Nothing to do with TFS, really. You just have to check in your dependencies to source control.

In your solution, add a folder called "Dependencies". Add a matching folder on disk in the same location in your solution hierarchy (annoying, I know). Add your dependent external DLLs to that directory.

enter image description here

As these are now part of the solution, they will travel with the solution into source control.

Reference these in your projects. It will look like this

enter image description here

but it should be recorded in your solution file as a relative path.

<Reference Include="Example">
  <HintPath>......DependenciesExample.DLL</HintPath>
</Reference>

If you're having problems with this not being the case, you can simply edit your project file and change the hint path.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...