0

I am developing a Web Application trying to connect to TFS using TFS API in C#. The following line of code is generating a runtime error when deployed onto ISS. It works fine on my local box :

WorkItemStore workItemStore = coll.GetService<WorkItemStore>();

Here is my entire code :

Uri url = new Uri("https://xxx.xx.com:443/xxx/xxx");

NetworkCredential nc = new NetworkCredential("xx", "xx", "xx");
TfsTeamProjectCollection coll = new TfsTeamProjectCollection(url, nc);

coll.EnsureAuthenticated();

// Error causing code Begin
WorkItemStore workItemStore = coll.GetService<WorkItemStore>();

// Error causing code End

The error screenshot is as shown below :

enter image description here

Is there a way to solve it or a work around ?

here is the error message in the screenshot above :

*Description : An unhandled exception occured during the execution of the current web request. Please review the stack trace for more information about the error and where it originated inthe code.

Exception details : System.UnauthorizedAccessException: Access to the Path "C"\ProgramData\Microsoft\Team Foundation\3.0\Cache" is denied.

ASP.NET is not authorized to acccess the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP>NET has a base process identity {typically {MACHINE}}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonationg. If the application is impersonating via , the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in File Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP>NET account, and check the boxes for the desired access.*

Let me know if you also want to look at the stack strace ?

jessehouwing
  • 106,458
  • 22
  • 256
  • 341
CodeNinja
  • 3,188
  • 19
  • 69
  • 112
  • Can you transcribe the error message? I can't read the text in the screenshot -- it's tiny. – Daniel Mann Mar 30 '15 at 16:49
  • 2
    possible duplicate of [ASP.NET Web Application using TFS API, error on IIS server](http://stackoverflow.com/questions/28464621/asp-net-web-application-using-tfs-api-error-on-iis-server) – Daniel Mann Mar 30 '15 at 16:50
  • 1
    Have you actually gone through the steps to allow ASP.NET the required access to the mentioned folder? – jessehouwing Mar 30 '15 at 17:30

0 Answers0