Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iis System.UnauthorizedAccessException对注册表项的访问权限_Iis_Tfs - Fatal编程技术网

Iis System.UnauthorizedAccessException对注册表项的访问权限

Iis System.UnauthorizedAccessException对注册表项的访问权限,iis,tfs,Iis,Tfs,我有一些调用TFSAPI并返回团队元数据的代码。(例如,团队名称、区域路径等)该代码在Visual Studio ASP.NET MVC项目中本地运行良好,但在部署到服务器时失败 我尝试过但没有成功的方法: 我授予AppPool用户帐户对注册表项的完全控制权(不起作用) 另外,尝试授予每个人对注册表项的完全控制权(仍然不起作用) 对于如何为IIS部署的应用程序设置正确的配置权限以达到TFS API,我们将不胜感激。(下面的错误消息) 以下是应用程序生成的错误消息: System.Unauthor

我有一些调用TFSAPI并返回团队元数据的代码。(例如,团队名称、区域路径等)该代码在Visual Studio ASP.NET MVC项目中本地运行良好,但在部署到服务器时失败

我尝试过但没有成功的方法:

我授予AppPool用户帐户对注册表项的完全控制权(不起作用) 另外,尝试授予每个人对注册表项的完全控制权(仍然不起作用) 对于如何为IIS部署的应用程序设置正确的配置权限以达到TFS API,我们将不胜感激。(下面的错误消息

以下是应用程序生成的错误消息:

System.UnauthorizedAccessException异常

Access to the registry key 'HKEY_CURRENT_USER\Software\Microsoft\VSCommon\12.0\ClientServices\TokenStorage\VisualStudio' is denied.

System.UnauthorizedAccessException: Access to the registry key 'HKEY_CURRENT_USER\Software\Microsoft\VSCommon\12.0\ClientServices\TokenStorage\VisualStudio' is denied.
   at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
   at Microsoft.Win32.RegistryKey.CreateSubKeyInternal(String subkey, RegistryKeyPermissionCheck permissionCheck, Object registrySecurityObj, RegistryOptions registryOptions)
   at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey, RegistryKeyPermissionCheck permissionCheck, RegistryOptions options)
   at Microsoft.VisualStudio.Services.Common.TokenStorage.RegistryTokenStorageHelper.GetRootKey(String subkeyName)
   at Microsoft.VisualStudio.Services.Common.TokenStorage.RegistryTokenStorage.RetrieveToken(VssTokenKey tokenKey)
   at Microsoft.TeamFoundation.Client.TfsClientCredentialStorage.RetrieveToken(Uri serverUrl, VssCredentialsType credentialType)
   at Microsoft.TeamFoundation.Client.CookieCredential.OnCreateTokenProvider(Uri serverUrl, HttpWebResponse response)
   at Microsoft.TeamFoundation.Client.IssuedTokenCredential.CreateTokenProvider(Uri serverUrl, HttpWebResponse response, IssuedToken failedToken)
   at Microsoft.TeamFoundation.Client.TfsClientCredentials.TryGetTokenProvider(Uri serverUrl, IssuedTokenProvider& provider)
   at Microsoft.TeamFoundation.Client.Channels.TfsHttpRequestHelpers.PrepareWebRequest(HttpWebRequest webRequest, Guid sessionId, String operationName, CultureInfo cultureInfo, TfsRequestSettings settings, TfsClientCredentials credentials, IdentityDescriptor impersonate, IssuedToken& currentToken, IssuedTokenProvider& tokenProvider)
   at Microsoft.TeamFoundation.Client.Channels.TfsHttpRequestHelpers.CreateSoapRequest(Uri requestUri, Guid sessionId, String soapAction, String operationName, CultureInfo cultureInfo, TfsRequestSettings settings, TfsClientCredentials credentials, IdentityDescriptor impersonate, IssuedToken& currentToken, IssuedTokenProvider& tokenProvider)
   at Microsoft.TeamFoundation.Client.Channels.TfsHttpWebRequest.CreateWebRequest()
   at Microsoft.TeamFoundation.Client.Channels.TfsHttpWebRequest.SendRequest()
   at Microsoft.TeamFoundation.Client.Channels.TfsHttpRequestChannel.Request(TfsMessage message, TimeSpan timeout)
   at Microsoft.TeamFoundation.Client.Channels.TfsHttpClientBase.Invoke(TfsClientOperation operation, Object[] parameters, TimeSpan timeout, Object[]& outputs)
   at Microsoft.TeamFoundation.Framework.Client.RegistrationProxy.GetRegistrationEntries(String toolId)
   at Microsoft.TeamFoundation.Framework.Client.RegistrationService.RefreshMemoryCache()
   at Microsoft.TeamFoundation.Framework.Client.RegistrationService.Microsoft.TeamFoundation.Server.IRegistration.GetRegistrationEntries(String toolId)
   at Microsoft.TeamFoundation.Framework.Client.IdentityManagementService..ctor(TfsConnection tfsBase)
   at Microsoft.TeamFoundation.Framework.Client.IdentityManagementService2..ctor(TfsConnection tfsBase)
   at Microsoft.TeamFoundation.Client.TfsConnection.CreateInternalProxy(Type serviceType)
   at Microsoft.TeamFoundation.Client.TfsConnection.GetServiceInstance(Type serviceType, Object serviceInstance)
   at Microsoft.TeamFoundation.Client.TfsConnection.GetService(Type serviceType)
   at Microsoft.TeamFoundation.Client.TfsConnection.GetService[T]()
   at Microsoft.TeamFoundation.Client.TfsTeamService.QueryTeams(String projectId)

我也遇到了同样的问题,通过将IIS应用程序池设置中的“加载用户配置文件”设置为True解决了这个问题


我不知道这是否是TFS 2013中的新依赖项,也不知道IIS 8.5是否更改了默认设置,但这为我解决了这个问题。

我遇到了同样的问题,但将Load User Profile设置为TRUE对我来说不起作用。最终的工作是进入注册表并为相应的用户添加“HKCU\Software\Microsoft\VSCommon\12.0\ClientServices”键。显然,当您试图在没有安装Visual Studio的系统上使用TFS程序集时,TFS程序集会变得有点古怪


任何将此信息添加到的人都应受到表扬。

我们遇到了此问题,并将IIS应用程序池设置中的“加载用户配置文件”设置为True对我们有效。但是,同样的问题再次出现,我们发现将IIS应用程序池设置中的“加载用户配置文件”设置为False再次修复了该问题。所以在我看来,正是这个设置的切换修复了一些东西,而不是它设置的实际值。无论IIS应用程序池中的“加载用户配置文件”设置为什么,我都会尝试将其切换到相反的值,刷新应用程序池,看看这是否有帮助。如果有人跟踪此问题的根本原因,请共享。

是否有可能将IIS配置为以中信任或低信任运行ASP.NET?无论您的实际权限如何,都拒绝访问注册表。。。看:这是一个有趣的想法。但不,信任不是问题。我默认安装了IIS和Windows Server 2012。Per docs:“默认情况下,ASP.NET应用程序域的信任级别为完全信任。ASP.NET中的部分信任行为在trustLevel元素的name属性设置为full以外的值时生效。”我还检查了\Windows\Microsoft.NET\Framework[版本]中的web.config文件,看起来信任级别为完全。还有其他想法吗?你和这个艾伦还有什么关系吗。我也遇到了同样的问题。服务器安装了TFS2013、VS2013和VS2012。我删除了VS的两个版本,但问题仍然存在。奇怪的是,我将Web服务部署到了我的机器上(不是使用IIS Express,而是在IIS中创建一个网站),它工作得很好…非常棒的Greg-非常感谢您发布这篇文章,它立即为我解决了这个问题!我真的很想知道为什么它会修复它,以及您是如何确定这会修复它的。所以问题是未经授权访问HKEY_CURRENT_用户注册表项。在我的例子中,IIS作为应用程序池标识运行,我认为默认情况下不会加载用户配置文件。因此,没有“当前用户”。如果将“加载用户配置文件”设置为true,则会加载配置文件,并且可以访问HKEY_CURRENT_用户。正如你可能知道的,我不知道确切的信息,这正是我的推断。是的。这对我也很管用。我正在把这一个标记为完成。细节------1。我转到这个URL并抓取了配置设置。2.我更新了IIS ApplicationHost.config并重置了IIS。3.代码特性和TFS API调用现在正按预期工作。