DCSIMG
Problem Creating Work Item Store From Web Service (Work Item Tracking Metadata Cache) - Shai Raiten's Blog

Shai Raiten's Blog

It's all about code...

Problem Creating Work Item Store From Web Service (Work Item Tracking Metadata Cache)

Problem Creating Work Item Store From Web Service (Work Item Tracking Metadata Cache)

I create a Web Service for a customer and during the development I had a little problem getting WorkItemStore object.

Error 1:

Cannot complete the operation. An unexpected error occurred.
Stake:   at Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore.HandleComException(Int32 hr)
   at Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore.DatastoreClass.ConnectEx(String connectionString, Int32 hCredentials, String defaultCachePath, String instanceId, String userSamName, String userFriendlyName, String userSid)
   at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.InitializeInternal()
   at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.Microsoft.TeamFoundation.Client.ITeamFoundationServerObject.Initialize(TeamFoundationServer teamFoundationServer)
   at Microsoft.TeamFoundation.Client.TeamFoundationServer.CreateITFSObjectInstance(Assembly assembly, String fullName)
   at Microsoft.TeamFoundation.Client.TeamFoundationServer.GetService(Type serviceType)
   at WorkItemChangeService.WorkItemChangeEvent.Notify(String eventXml) in D:\Shai Raiten\Visual Studio 2008\Projects\WorkItemChangeService\WorkItemChangeService\WorkItemChangeEvent.asmx.cs:line 42.

Error 2:

Detailed Message: TF200034: A subscriber to a Team Foundation event (subscription ID=312) raised the following exception:
Exception Message: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Microsoft.TeamFoundation.WorkItemTracking.Client.UnexpectedErrorException: Cannot complete the operation. An unexpected error occurred. ---> Microsoft.TeamFoundation.WorkItemTracking.Client.ClientException: Access is denied.
(Windows)
Could not create metadata cache directory 'C:\Documents and Settings\Default User\Local Settings\Application Data\Microsoft\Team Foundation\2.0\Cache\c9a5515a-0e91-4550-9c54-74c84a4cfd97'. (Work Item Tracking Metadata Cache)
The system cannot find the path specified.
(Windows)
Could not create metadata cache directory 'C:\Documents and Settings\Default User\Local Settings\Application Data\Microsoft\Team Foundation\2.0\Cache\c9a5515a-0e91-4550-9c54-74c84a4cfd97\0'. (Work Item Tracking Metadata Cache)
Could not open file ''. (Work Item Tracking Metadata Cache)
Access is denied.
(Windows)
Could not create metadata cache directory 'C:\Documents and Settings\Default User\Local Settings\Application Data\Microsoft\Team Foundation\2.0\Cache\c9a5515a-0e91-4550-9c54-74c84a4cfd97'. (Work Item Tracking Metadata Cache)
The system cannot find the path specified.
(Windows)
Could not create metadata cache directory 'C:\Documents and Settings\Default User\Local Settings\Application Data\Microsoft\Team Foundation\2.0\Cache\c9a5515a-0e91-4550-9c54-74c84a4cfd97\0'. (Work Item Tracking Metadata Cache)
Could not open file ''. (Work Item Tracking Metadata Cache)
Could not initialize metadata cache for product 'c9a5515a-0e91-4550-9c54-74c84a4cfd97'. (Work Item Tracking Metadata Cache)
Unspecified error
(Windows)
   --- End of inner exception stack trace ---
   at WorkItemChangeService.WorkItemChangeEvent.Notify(String eventXml) in D:\Shai Raiten\Visual Studio 2008\Projects\WorkItemChangeService\WorkItemChangeService\WorkItemChangeEvent.asmx.cs:line 55
   --- End of inner exception stack trace --- (type SoapException)

Exception Stack Trace:    at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at Microsoft.TeamFoundation.Server.NotificationClient.Notify(String eventXml, String tfsIdentityXml, SubscriptionInfo SubscriptionInfo)

 

The problem is in the ClientCacheDirectoryForInstance property on the TeamFoundationServer class.

The problem was fixed by giving write permissions for the application pool to the Cache folder.

The Solution

Enable Integrated Windows Authentication and Turn Off Anonymous Access

Open inetmgr, right click “Web Application” and choose properties.

Select “Directory Security” and enter “Authentication Methods

Clear all checkbox except “Integrated Windows Authentication”.

image

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Create an Application Pool for a Web Application

Create a default application pool and enter the Identity  of the user name for the domain account under which you want your Web page to run in the User name field, using the domain\user name format.

 1

 

Change Web Application to Work With the New ApplicationPool

 2

This will fix the problem.

Comments

Problem Creating Work Item Store From Web Service (Work Item … « Domain Namez said:

Pingback from  Problem Creating Work Item Store From Web Service (Work Item … «  Domain Namez

# August 31, 2009 6:38 AM

Yilille said:

Perfect work!,

# October 10, 2009 9:53 PM

Lothirawen said:

Excellent site. It was pleasant to me.,

# October 11, 2009 3:18 AM

Alienyth said:

I want to say - thank you for this!,

# October 12, 2009 2:20 AM

Acaligord said:

Great. Now i can say thank you!,

# October 12, 2009 7:54 AM

Regimantas said:

I had this problem and solved it this way.

But I still sometimes get this error. It just starts to appear and I have to restart IIS for it to go away. No idea why..

# March 19, 2010 4:08 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: