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.

• Your <strong>Team</strong> <strong>Foundation</strong> user ID must have permission to administer a build. Ask you<br />

administrator if you are unsure of your user’s allowed permissions.<br />

• A team build must already exist for your project. You can check this by looking at<br />

<strong>Team</strong> Build in the <strong>Visual</strong> <strong>Studio</strong> <strong>Team</strong> Explorer.<br />

Step 1 – Test the Build<br />

Start by testing the team build to make sure there are no problems before you turn on<br />

code analysis. You can do this by performing the following steps:<br />

1. In <strong>Visual</strong> <strong>Studio</strong>, open <strong>Team</strong> Explorer in <strong>Visual</strong> <strong>Studio</strong><br />

2. Expand the node for your team project<br />

3. Expand the <strong>Team</strong> Builds node<br />

4. Right Click an existing team build and then select Build <strong>Team</strong> Project<br />

5. Ensure the build has completed successfully. If there are build breaks or the build is<br />

not able to complete, fix these errors before moving to the next step.<br />

Step 2 – Turn On Code Analysis for the Build<br />

Once you have verified that the build is working properly, you can turn on code analysis.<br />

Use the following steps to turn on code analysis:<br />

1. Open Source Control Explorer.<br />

2. In Source Control Explorer, expand your team project folder.<br />

3. Expand the <strong>Team</strong>BuildTypes folder.<br />

4. Select the team build folder for which you want to turn on code analysis.<br />

5. Check out TFSBuild.proj file from source control. You may need to perform a Get<br />

Latest Version operation on the folder first.<br />

6. In Source Control Explorer, double click TFSBuild.Proj to open it.<br />

7. If you want all projects to run code analysis, regardless of project settings, change the<br />

tag to Always.<br />

8. If you want to run code analysis on each project based on project settings, change the<br />

tag to Default.<br />

9. If you are using per-project settings and want to turn on code analysis for a project:<br />

a. Open the solution in <strong>Visual</strong> <strong>Studio</strong>.<br />

b. In Solution Explorer, right click on the project.<br />

c. Select Properties.<br />

d. Click on Code Analysis.<br />

e. Select the Enable Code Analysis check box.<br />

f. Check out the .csproj file for the project from source control.<br />

g. Save the file by clicking the save icon in toolbar while properties window is<br />

displayed.<br />

h. Check the .csproj file for the project back into source control.<br />

10. Save TFSBuild.proj and check it back into source control.<br />

Step 3 – Test Code Analysis<br />

Once you have turned on code analysis for a team build, you can test to make sure it is<br />

working properly. Use the following steps to test code analysis for your build:<br />

1. In <strong>Team</strong> Explorer, right click the build type and then click Build <strong>Team</strong> Project.

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

Saved successfully!

Ooh no, something went wrong!