Access is denied: Could not create metadata cache directory
After installing a web application that interacts with the TFS API for Work items I get an exception. This works fine on Windows XP, but I'm sure there is a problem with the permissions on some folder, any idea what folder I should give permission to?
Access is denied.
(Windows)
Could not create metadata cache directory 'Ơ 耇ƠƠ '. (Work Item Tracking Metadata Cache)
The system cannot find the path specified.
(Windows)
Could not create metadata cache directory 'Ơ 耇ƠƠ '. (Work Item Tracking Metadata Cache)
Could not open file 'ƠਨƠƠƠ'. (Work Item Tracking Metadata Cache)
Access is denied.
(Windows)
Could not create metadata cache directory 'Ơ 耇ƠƠ '. (Work Item Tracking Metadata Cache)
The system cannot find the path specified.
(Windows)
Could not create metadata cache directory 'Ơ 耇ƠƠ '. (Work Item Tracking Metadata Cache)
Could not open file 'ƠਨƠƠƠ'. (Work Item Tracking Metadata Cache)
Could not initialize metadata cache for product '櫠Ԅ╌ԅԅ╤ԅ蜁蜁 '. (Work Item Tracking Metadata Cache)
Unspecified error
(Windows)Trace:
UnexpectedErrorException: Cannot complete the operation. An unexpected error occurred.]
Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore.HandleComException(Int32 hr) +98
Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore.DatastoreClass.ConnectEx(String connectionString, Int32 hCredentials, String defaultCachePath, String instanceId, String userSamName, String userFriendlyName, String userSid) +379
Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.InitializeInternal() +821
Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.Microsoft.TeamFoundation.Client.ITeamFoundationServerObject.Initialize(TeamFoundationServer teamFoundationServer) +90
Microsoft.TeamFoundation.Client.TeamFoundationServer.CreateITFSObjectInstance(Type serviceType) +137
Microsoft.TeamFoundation.Client.TeamFoundationServer.GetService(Type serviceType) +241
Microsoft.TeamFoundation.VersionControl.Client.Changeset.get_WorkItemStore() +31
Microsoft.TeamFoundation.VersionControl.Client.Changeset.get_WorkItems() +24
TeamFoundationExtensions.Controls.ChangesetRender.ProcessRequest(HttpContext context) in C:\Documents and Settings\sonbje\My Documents\Visual Studio 2005\Workspaces\Automaton\TeamFoundationExtensions\Controls\ChangesetRender.cs:88
changeset.ProcessRequest(HttpContext context) in c:\Inetpub\www\Automaton\changeset.ashx:11
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
Answers
After some heavy use of Reflector I found out the problem is the ClientCacheDirectoryForInstance property on the TeamFoundationServer class.
This property returns the following for Windows XP (IIS 5.1):
C:\Documents and Settings\SONBJE2\ASPNET\Local Settings\Application Data\Microsoft\Team Foundation\1.0\Cache\d68b6c57-7fee-440a-b708-054fa006453f_http
While for Windows Server 2003 (IIS 6.0) it returns:
C:\Documents and Settings\Default User\Local Settings\Application Data\Microsoft\Team Foundation\1.0\Cache\d68b6c57-7fee-440a-b708-054fa006453f_http
The problem was fixed by giving IIS_WPG write permission to the Cache folder.
All Replies
After some heavy use of Reflector I found out the problem is the ClientCacheDirectoryForInstance property on the TeamFoundationServer class.
This property returns the following for Windows XP (IIS 5.1):
C:\Documents and Settings\SONBJE2\ASPNET\Local Settings\Application Data\Microsoft\Team Foundation\1.0\Cache\d68b6c57-7fee-440a-b708-054fa006453f_http
While for Windows Server 2003 (IIS 6.0) it returns:
C:\Documents and Settings\Default User\Local Settings\Application Data\Microsoft\Team Foundation\1.0\Cache\d68b6c57-7fee-440a-b708-054fa006453f_http
The problem was fixed by giving IIS_WPG write permission to the Cache folder.
- hi! i had the same proble, but i what did was, i deleted the cache data in the server.. then all works fine :)
- I fixed this by adding a key to the <appsettings> part of my web.config
<add key="WorkItemTrackingCacheRoot" value="pathtofolder"/>
Allthough the webserver's useraccount should still have write access to this folder it makes it a little easier to setup. - OutStanding!
<appSettings>
<add key="WorkItemTrackingCacheRoot" value="pathtofolder"/>
was absolutely the ticket
THANKS! Thanks for the information. I would like to add some updates.
In TFS 2008 use C:\Documents and Settings\Default User\Local Settings\Application Data\Microsoft\Team Foundation\2.0\Cache folder.If you are using the TFS application pool assign the permission to the user defined in the Identity tab (eg. TFSService)
Cenk


