
Captcha is a type of challenge-response test used in computing as an attempt to ensure that the response is generated by a person.
When building public web sites captcha is very important to avoid script and bots running on your web site.
First go to reCAPTCHA site and register for unique Key, then Download reCAPTCHA .NET Library.
Save you Public and Private keys safely.

Now, Let’s start new ASP.NET MVC 3 Web Application Project in Visual Studio 2010
Download Demo Project

Choose to create from “Internet Application” template

Add the Recaptcha dll as reference to your project.

Modify site Web.config with new keys under the appSettings section and add the keys we received before.
- ReCaptchaPrivateKey
- ReCaptchaPublicKey

Open the Controllers folder, open the AccountController file and locate the Register method, add new attribute:
[RecaptchaControlMvc.CaptchaValidatorAttribute]

And add the reCAPTCHA logic to your Registration Code
[HttpPost]
[RecaptchaControlMvc.CaptchaValidatorAttribute]
public ActionResult Register(RegisterModel model, bool captchaValid)
{
if (!captchaValid)
{
ModelState.AddModelError("", "You did not type the verification
word correctly. Please try again.");
}
else
{
if (ModelState.IsValid)
{
// Attempt to register the user
MembershipCreateStatus createStatus;
Membership.CreateUser(model.UserName, model.Password,
model.Email, null, null, true, null,
out createStatus);
if (createStatus == MembershipCreateStatus.Success)
{
FormsAuthentication.SetAuthCookie(model.UserName, false);
return RedirectToAction("Index", "Home");
}
else
{
ModelState.AddModelError("",
ErrorCodeToString(createStatus));
}
}
}
// If we got this far, something failed, redisplay form
return View(model);
}
Now placed the following command in the Register.cshtml file:
@Html.Raw(Html.GenerateCaptcha())

Run your web site and enter the registration page, now you have to enter captcha before compiling the registration.

Download Demo Project
First, what is the Build Service Host or IBuildServiceHost?
The BuildServiceHost object represent the physical location of the Controller and/or Agent objects. The name property is usually the machine name that the Controller or Agent lives on. In earlier versions, this was simply the Machine Name property on the Agent.
Now, I’m working with a customer works with Lab Manager and after upgrading the SCVVM and perform some port changes we faced an issue – The Build Service Host stuck in your server with no way to remove it. (there is no UI for Build Hosts)
Now when trying to register the Lab environments we received an error the Host with the same name already exists, so I’ve built a small tool to help me managing the Build Service Hosts.
Download 
Step 1: Connect To TFS and Obtain IBuildServer
As any TFS API article we first need to connect TFS and from the TFS Object Model to obtain the IBuildServer object.
private void BtnConnectClick(object sender, RoutedEventArgs e)
{
var tpp = new TeamProjectPicker(TeamProjectPickerMode.NoProject, false);
tpp.ShowDialog();
if (tpp.SelectedTeamProjectCollection != null &&
(tpp.SelectedTeamProjectCollection == null &&
!tpp.SelectedTeamProjectCollection.HasAuthenticated)) return;
_tfs = tpp.SelectedTeamProjectCollection;
_buildSrv = _tfs.GetService<IBuildServer>();
ShowList();
}
Showing the current Hosts in the TFS:
private void ShowList()
{
buildList.ItemsSource = _buildSrv.QueryBuildServiceHosts("*");
}
The IBuildServer is running Team Foundation Build and has control on everything related to Builds.
Step 2: Delete, Create and Rename
After we obtain all Build Service Hosts we will use the IBuildServer to Create, Delete and Rename the hosts on our TFS.
private void DeleteHost(string hostName)
{
IBuildServer buildServer = _tfs.GetService<IBuildServer>();
IBuildServiceHost bsh = buildServer.GetBuildServiceHost(hostName);
bsh.Delete();
}
private void Create(string hostName)
{
IBuildServer buildServer = _tfs.GetService<IBuildServer>();
IBuildServiceHost hostsrv = buildServer.CreateBuildServiceHost(hostName,
"http", hostName, 8181);
hostsrv.Save();
}
private void Rename(string currentHostName, string newHostName)
{
IBuildServer buildServer = _tfs.GetService<IBuildServer>();
IBuildServiceHost hostsrv = buildServer.GetBuildServiceHost
(currentHostName);
hostsrv.Name = newHostName;
UriBuilder uriBuilder = new UriBuilder(hostsrv.BaseUrl);
uriBuilder.Host = newHostName;
hostsrv.BaseUrl = uriBuilder.Uri;
hostsrv.Save();
}
Download