当我尝试在我的MVC应用程序的HomeController中创建一个Microsoft.TeamFoundation.Client.TeamFoundationServer对象,我收到以下错误:
TF30076:提供不对应于一个服务器URI,可以发现该服务器名称{TfsServerName}。 确认服务器名称是否正确。
我使用Windows身份验证的MVC应用程序,所以Controller.User属性填充为我域登录{域\用户名}。
当我调试使用Visual Studio开发服务器,代码工作得很好。 我开始使用IIS虚拟目录后,代码的执行开始返回上述错误。
我使用的Visual Studio / TFS 2008(V9.0),Windows XP环境,以及ASP.NET MVC 1.0。
例外:
Microsoft.TeamFoundation.TeamFoundationInvalidServerNameException:TF30076:提供不对应于一个服务器URI,可以发现该服务器名称{XXXX}。 确认服务器名称是否正确。 在Microsoft.TeamFoundation.Client.TeamFoundationServer.GetUriForName(字符串名称)在Microsoft.TeamFoundation.Client.TeamFoundationServer.get_Uri()在Microsoft.TeamFoundation.Client.CheckAuthenticationProxy..ctor(TeamFoundationServer服务器)在Microsoft.TeamFoundation.Client.TeamFoundationServer。在d认证(布尔useProvider,ICredentialsProvider提供商)在Microsoft.TeamFoundation.Client.TeamFoundationServer.Authenticate()在Portal.TfsHelper.AuthenticateTfsServer():\门户\门户\模型\ TfsHelper.cs:线99
代码抛出异常如下所示:
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);
}
为什么这有什么想法是怎么回事?
异常调用“RegisteredServers.AddServer后出现的(”服务器名称“” HTTP://服务器名称:8080 “);”:
System.Security.SecurityException:请求的注册表访问是不允许的。 在System.ThrowHelper.ThrowSecurityException(ExceptionResource资源)在Microsoft.Win32.RegistryKey.OpenSubKey(字符串名称,布尔可写)在Microsoft.TeamFoundation.Client.RegisteredServers.OpenCurrentUser(布尔可写,布尔shouldCreate)在Microsoft.TeamFoundation.Client.RegisteredServers .AddServer(字符串serverFriendlyName,字符串的serverUrl)在Portal.Controllers.HomeController..ctor()中d:\门户\门户\控制器\ HomeController.cs:线42失败是该组件的区域:我的电脑