When I try to create a Microsoft.TeamFoundation.Client.TeamFoundationServer object in the HomeController of my MVC application, I receive the following error:
TF30076: The server name {TfsServerName} provided does not correspond to a server URI that can be found. Confirm that the server name is correct.
I am using Windows Authentication for the MVC app, so the Controller.User property is populated as my domain login {domain\username}.
When I debugged using the Visual Studio Development Server, the code worked fine. After I began using a virtual directory in IIS, the execution of the code began returning the aforementioned error.
I am using Visual Studio / TFS 2008 (v9.0), Windows XP environment, and ASP.NET MVC 1.0.
Exception:
Microsoft.TeamFoundation.TeamFoundationInvalidServerNameException: TF30076: The server name {xxxx} provided does not correspond to a server URI that can be found. Confirm that the server name is correct. at Microsoft.TeamFoundation.Client.TeamFoundationServer.GetUriForName(String name) at Microsoft.TeamFoundation.Client.TeamFoundationServer.get_Uri() at Microsoft.TeamFoundation.Client.CheckAuthenticationProxy..ctor(TeamFoundationServer server) at Microsoft.TeamFoundation.Client.TeamFoundationServer.Authenticate(Boolean useProvider, ICredentialsProvider provider) at Microsoft.TeamFoundation.Client.TeamFoundationServer.Authenticate() at Portal.TfsHelper.AuthenticateTfsServer() in D:\Portal\Portal\Models\TfsHelper.cs:line 99
Code throwing the exception is shown below:
try
{
// authenticate before using tfs server
//TfsServer is created using the following: TfsServer = new TeamFoundationServer("server-name");
if (!TfsServer.HasAuthenticated)
{
TfsServer.Authenticate();
_hasAuthenticated = true;
}
}
catch (Exception ex)
{
#warning: temporary error handling for TFS authentication
String exString = ex.ToString();
throw new Exception(ex.Message, ex.InnerException);
}
Any thoughts on why this is happening?
Exception appearing after calling "RegisteredServers.AddServer("server-name", "http://server-name:8080");":
System.Security.SecurityException: Requested registry access is not allowed. at System.ThrowHelper.ThrowSecurityException(ExceptionResource resource) at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) at Microsoft.TeamFoundation.Client.RegisteredServers.OpenCurrentUser(Boolean writable, Boolean shouldCreate) at Microsoft.TeamFoundation.Client.RegisteredServers.AddServer(String serverFriendlyName, String serverUrl) at Portal.Controllers.HomeController..ctor() in D:\Portal\Portal\Controllers\HomeController.cs:line 42 The Zone of the assembly that failed was: MyComputer