26.04.2015 Views

Team Development with Visual Studio Team Foundation Server

Team Development with Visual Studio Team Foundation Server

Team Development with Visual Studio Team Foundation Server

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

• Use project references whenever possible.<br />

• Use file references only where necessary.<br />

• Use Copy Local = True for project and file references.<br />

For more information, see “Source Control Guidelines” in this guide.<br />

Automated Dependency Tracking<br />

Each time you build your local project, the build system compares the date and time of<br />

the referenced assembly file <strong>with</strong> the working copy on your development workstation. If<br />

the referenced assembly is more recent, the new version is copied to the local folder. One<br />

of the benefits of this approach is that a project reference established by a developer does<br />

not lock the assembly dynamic-link library (DLL) on the server and does not interfere in<br />

any way <strong>with</strong> the build process.<br />

Referencing Web Services<br />

In simpler systems where all of the projects for the system are contained <strong>with</strong>in the same<br />

team project, all developers end up <strong>with</strong> local working copies of all Web services because<br />

they are defined by <strong>Visual</strong> <strong>Studio</strong> projects <strong>with</strong>in the team project. When you open a<br />

solution from source control for the first time, all projects (including any Web services)<br />

are installed locally. Similarly, if a Web service is added to the solution by another<br />

developer, you install the Web service the next time you refresh your solution from<br />

source control. In this scenario, there is no need to publish Web services on a central Web<br />

server <strong>with</strong>in your team environment.<br />

For larger systems, Web services can be published through Internet Information <strong>Server</strong><br />

(IIS) on a centrally accessed Web server and not all developers need to locally install the<br />

Web service. Instead developers can access the Web service from their client projects,<br />

although you need to reference the Web service appropriately as discussed below.<br />

For more information, see “Source Control Guidelines” and “Source Control Practices”<br />

in this guide.<br />

Use Dynamic URLs When Referencing Web Services<br />

If you want to call a Web service, you must first add a Web reference to your project.<br />

This generates a proxy class through which you interact <strong>with</strong> the Web service. The proxy<br />

code initially contains a static Uniform Resource Locator (URL) for the Web service, for<br />

example http://localhost or http://SomeWeb<strong>Server</strong>.<br />

Important: For Web services in your current solution that execute on your computer,<br />

always use http://localhost rather than http://MyComputerName to ensure the reference<br />

remains valid on all computers.<br />

The static URL that is embedded <strong>with</strong>in the proxy is usually not the URL that you require<br />

in either the production or test environment. Typically, the required URL varies as your

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!