ASP.NET MVC的和TFS:入门TF30076错误 [英] ASP.NET-MVC and TFS: Getting TF30076 Error

查看:221
本文介绍了ASP.NET MVC的和TFS:入门TF30076错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在我的MVC应用程序的HomeController中创建一个Microsoft.TeamFoundation.Client.TeamFoundationServer对象,我收到以下错误:

When I try to create a Microsoft.TeamFoundation.Client.TeamFoundationServer object in the HomeController of my MVC application, I receive the following error:

TF30076:服务器名称{} TfsServerName提供
  不对应于一个服务器URI
  可以找到。确认
  服务器名称是正确的。

TF30076: The server name {TfsServerName} provided does not correspond to a server URI that can be found. Confirm that the server name is correct.

我使用Windows身份验证的MVC应用程序,所以Controller.User属性填充为我域登录{域\\用户名}。

I am using Windows Authentication for the MVC app, so the Controller.User property is populated as my domain login {domain\username}.

当我调试使用Visual Studio开发服务器中,code正常工作。我开始使用IIS虚拟目录之后,code的执行开始返回前面提到的错误。

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.

我使用的Visual Studio / TFS 2008(V9.0),Windows XP环境,以及ASP.NET MVC 1.0。

I am using Visual Studio / TFS 2008 (v9.0), Windows XP environment, and ASP.NET MVC 1.0.

例外:

Microsoft.TeamFoundation.TeamFoundationInvalidServerNameException:
  TF30076:服务器名称{XXXX}
  提供不对应于一个
  服务器URI,可以发现。确认
  服务器名称是正确的。在
  Microsoft.TeamFoundation.Client.TeamFoundationServer.GetUriForName(字符串
  名)在
  Microsoft.TeamFoundation.Client.TeamFoundationServer.get_Uri()
  在
  Microsoft.TeamFoundation.Client.CheckAuthenticationProxy..ctor(TeamFoundationServer
  服务器)的
  Microsoft.TeamFoundation.Client.TeamFoundationServer.Authenticate(布尔
  useProvider,ICredentialsProvider
  提供商)在
  Microsoft.TeamFoundation.Client.TeamFoundationServer.Authenticate()
  在
  Portal.TfsHelper.AuthenticateTfsServer()
  在
  D:\\门户\\门户\\型号\\ TfsHelper.cs:行
  99

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抛出异常如下:

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?

异常调用RegisteredServers.AddServer后出现的(服务器名称,HTTP://服务器名称:8080);

Exception appearing after calling "RegisteredServers.AddServer("server-name", "http://server-name: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行
失败是组件的区域:
我的电脑

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

推荐答案

在心理调试的一些尝试:

Some attempts at psychic debugging:


  • 您传递一个友好名称或真实,有效的URI?如果一个好记的名称,你有没有使用Visual Studio或注册表编辑器或类似初始化URI的映射? (HKLM \\软件\\微软\\ VisualStudio的\\ XXX \\ TeamFoundation \\服务器)

  • 是ASP中,需要不同的URI,达到TFS(例如NetBIOS名称VS完全合格的域名,不同的端口...)
  • 的网络环境中运行
  • 是代理服务器设置在两台机器上一样吗?防火墙?

  • 什么凭据传递你直通到TeamFoundationServer构造?


    • 如果没有(为样本code表示),哪些域帐户您的应用程序池下运行?

    • 是一个模拟的环境中运行,你构建TeamFoundationServer线程?您已验证模拟工作的方式,你期待什么呢?

    • Are you passing a friendly name or a real, valid URI? If a friendly name, have you used Visual Studio or regedit or similar to initialize the URI mapping? (HKLM\Software\Microsoft\VisualStudio\xxx\TeamFoundation\Servers)
    • Is ASP running in a network context which requires a different URI to reach TFS (e.g. netbios name vs fully qualified domain name, different port...)
    • Are the proxy settings the same on the two machines? Firewall?
    • What credentials are you passing thru to the TeamFoundationServer constructor?
      • If none (as the sample code shows), what domain account is your App Pool running under?
      • Is the thread where you construct TeamFoundationServer running in an impersonated context? Have you verified impersonation is working the way you expect?

      这篇关于ASP.NET MVC的和TFS:入门TF30076错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆