|
Hi I tried to checkout the file from tfs version control and the file gets checkedout and after modifying the file the check in failing with the following error: TF30063: You are not authorized to access Microsoft-IIS/6.0.
I have a requirement to checkout a file and change the file and checkin the file.
I tried all means but not able to get through.
Here is the code snippet:
void CheckOutCheckIn(string filename,bool Undeploy)
{
try
{
if (CheckTheRunningJob(filename) == true)
{
Label2.Text = filename + " job is in the running state. Please try later.";
return;
}
TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer(tfsName);
VersionControlServer vcs = (VersionControlServer)tfs.GetService(typeof(VersionControlServer));
UserName = vcs.AuthenticatedUser;
Workspace[] workspaces = vcs.QueryWorkspaces(WorkspaceName, UserName,ComputerName);
Workspace workspace = null;
if (workspaces.Length == 0)
workspace = vcs.CreateWorkspace(WorkspaceName, UserName, WorkspaceComment);
else
workspace = workspaces[0];
if (!workspace.IsServerPathMapped(ProjectServerPath))
{
workspace.Map(ProjectServerPath, ProjectLocalPath);
}
PendingSet[] sets = workspace.QueryPendingSets(new string[] {"$/Manifests/ManifestStore/" + filename},RecursionType.Full, WorkspaceName, UserName, false);
if (sets.Length != 1)
{
Label2.Text = "No pending sets.";
//workspace.PendEdit(new string[] { DIR + filename }, RecursionType.OneLevel, null, LockLevel.CheckOut);
workspace.PendEdit(new string[] { DIR + filename });
LoadGrid(Undeploy);
CheckTheService();
dm.WriteXml(DIR + filename);
PendingChange[] pendingChange = workspace.GetPendingChanges(new string[] { DIR + filename });
if (pendingChange.Length >= 0)
{
Label2.Text = Label2.Text + "Comming here." + pendingChange;
int changesetNumber = workspace.CheckIn(pendingChange, UserName + " Modified at :" + DateTime.Today.ToString());
Label2.Text = Label2.Text + "Checked in changeset: " + changesetNumber;
}
//PendingChange[] changes = workspace.GetPendingChanges(DIR + filename,RecursionType.OneLevel);
//if (changes.Length > 0)
//{
// int changeSetNumber =
// workspace.CheckIn(changes, " Checked in the file" + DateTime.Today.ToString());
// Label2.Text = Label2.Text + " Checked in the file: " + DIR + filename + " Changeset: " + changeSetNumber;
// UpdateJobStatus(filename);
// Label2.Text = Label2.Text + " Updated the database.";
//}
UpdateJobStatus(filename);
SendEMail("ManifestChanged", DIR + filename);
Label2.Text = Label2.Text + " Email Sent.";
Response.Redirect("Run.aspx");
}
else
{
Label2.Text = "The file is checkedout.";
}
} catch (Exception ex) {
Label2.Text = "Exception occured :" + ex.Message;
} finally
{
}
}
Here is the log:
9/26/2006 3:19:16 PM (pid 5544, tid 5604, 30 ms) Using cache file path C:\Documents and Settings\\Local Settings\Application Data\Microsoft\Team Foundation\1.0\Cache\VersionControl.config 9/26/2006 3:19:16 PM (pid 5544, tid 5604, 30 ms) Session ID: 36aa14fa-b8a7-47f9-af1b-226a9d5b554a 9/26/2006 3:19:16 PM (pid 5544, tid 5604, 449 ms) ConnectionLimit = 32, BypassProxyOnLocal = False, EnableCompression = True, DefaultTimeout = 300000 9/26/2006 3:19:16 PM (pid 5544, tid 5604, 449 ms) User agent: Team Foundation (aspnet_wp.exe, 8.0.50727.147) 9/26/2006 3:19:16 PM (pid 5544, tid 5604, 573 ms) Web method running: [http://xxxxxxx01:8080/Services/v1.0/ServerStatus.asmx] CheckAuthentication[Ser] 9/26/2006 3:19:16 PM (pid 5544, tid 5604, 681 ms) Web method response: [http://xxxxxxx01:8080/Services/v1.0/ServerStatus.asmx] CheckAuthentication[Ser] 179 ms 9/26/2006 3:19:17 PM (pid 5544, tid 5604, 1409 ms) Web method running: [http://xxxxxxx01:8080/Services/v1.0/Registration.asmx] GetRegistrationEntries[Ser] 9/26/2006 3:19:17 PM (pid 5544, tid 5604, 1456 ms) Web method response: [http://xxxxxxx01:8080/Services/v1.0/Registration.asmx] GetRegistrationEntries[Ser] 46 ms 9/26/2006 3:19:17 PM (pid 5544, tid 5604, 1827 ms) Web method running: [http://xxxxxxx01:8080/Services/v1.0/GroupSecurityService.asmx] ReadIdentity[Ser] 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 1874 ms) Web method response: [http://xxxxxxx01:8080/Services/v1.0/GroupSecurityService.asmx] ReadIdentity[Ser] 33 ms 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 1889 ms) Time spent getting service URL ISCCProvider: 0 ms 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 1889 ms) CreateWebRequest() -- Uri: http://xxxxxxx01:8080/VersionControl/v1.0/repository.asmx 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 1889 ms) request.AutomaticDecompression: GZip 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 1889 ms) Web method running: [VersionControl/] QueryWorkspaces[Ver] 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 1920 ms) HTTP headers: Content-Encoding: Vary: Accept-Encoding Transfer-Encoding: chunked Cache-Control: private, max-age=0 Content-Type: application/soap+xml; charset=utf-8 Date: Tue, 26 Sep 2006 19:19:13 GMT Server: Microsoft-IIS/6.0 X-AspNet-Version: 2.0.50727 X-Powered-By: ASP.NET
9/26/2006 3:19:18 PM (pid 5544, tid 5604, 1920 ms) Web method response: [VersionControl/] QueryWorkspaces[Ver] 20 ms 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 1920 ms) CreateWebRequest() -- Uri: http://xxxxxxx01:8080/VersionControl/v1.0/repository.asmx 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 1920 ms) request.AutomaticDecompression: GZip 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 1920 ms) Web method running: [VersionControl/] QueryPendingSets[Ver] 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 1936 ms) HTTP headers: Content-Encoding: Vary: Accept-Encoding Transfer-Encoding: chunked Cache-Control: private, max-age=0 Content-Type: application/soap+xml; charset=utf-8 Date: Tue, 26 Sep 2006 19:19:13 GMT Server: Microsoft-IIS/6.0 X-AspNet-Version: 2.0.50727 X-Powered-By: ASP.NET
9/26/2006 3:19:18 PM (pid 5544, tid 5604, 1936 ms) Web method response: [VersionControl/] QueryPendingSets[Ver] 20 ms 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 1936 ms) CreateWebRequest() -- Uri: http://xxxxxxx01:8080/VersionControl/v1.0/repository.asmx 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 1936 ms) request.AutomaticDecompression: GZip 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 1936 ms) Web method running: [VersionControl/] PendChanges[Ver] 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 2029 ms) HTTP headers: Content-Encoding: Vary: Accept-Encoding Transfer-Encoding: chunked Cache-Control: private, max-age=0 Content-Type: application/soap+xml; charset=utf-8 Date: Tue, 26 Sep 2006 19:19:13 GMT Server: Microsoft-IIS/6.0 X-AspNet-Version: 2.0.50727 X-Powered-By: ASP.NET
9/26/2006 3:19:18 PM (pid 5544, tid 5604, 2029 ms) Web method response: [VersionControl/] PendChanges[Ver] 92 ms 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 2029 ms) ProcessOperation() -- processing operation: GetOperation instance 65488131 HashValue: [16]19, 140, 30, 132, 38, 244, 251, 101, 249, 78, 246, 218, 135, 228, 169, 70 ItemType: File ItemId: 73768 SourceLocalItem: C:\Manifests\ManifestStore\Dev01.xml TargetLocalItem: C:\Manifests\ManifestStore\Dev01.xml TargetServerItem: $/Manifests/ManifestStore/Dev01.xml VersionServer: 3049 VersionLocal: 3049 DeletionId: 0 ChangeType: Edit LockLevel: None IsLatest: True PendingChangeId: -98567 HasConflict: False ConflictingChangeType: None ConflictingItemId: 0 DownloadUrl: sfid=39798,0,0,0,0,0,0,0,0,0&ts=632949815539074944&s=bzf1lQEYBM%2BOi1q5oyuGcg9ENt34uq0s28Rd40qoonP%2FPqb6%2Fmfzmr66eeEKTMYKYabkGwhtSMbsDyz2UbAk77i1Hyhu8GnnyRsy7d0838ZTZ403V6b%2FrR4MOWJ9CFXMLBAOHd3KEVnAir1r57nO1hI5F4zmKDfj1iqEIVrGqe4%3D&fid=39798
9/26/2006 3:19:18 PM (pid 5544, tid 5604, 2029 ms) Recording OperationStatus.Getting for $/Manifests/ManifestStore/Dev01.xml 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 2029 ms) DownloadFiles: 2 ms 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 2029 ms) Acknowledgements: 0 ms 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 2075 ms) CreateWebRequest() -- Uri: http://xxxxxxx01:8080/VersionControl/v1.0/repository.asmx 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 2075 ms) request.AutomaticDecompression: GZip 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 2091 ms) Web method running: [VersionControl/] QueryPendingSets[Ver] 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 2106 ms) HTTP headers: Content-Encoding: Vary: Accept-Encoding Transfer-Encoding: chunked Cache-Control: private, max-age=0 Content-Type: application/soap+xml; charset=utf-8 Date: Tue, 26 Sep 2006 19:19:14 GMT Server: Microsoft-IIS/6.0 X-AspNet-Version: 2.0.50727 X-Powered-By: ASP.NET
9/26/2006 3:19:18 PM (pid 5544, tid 5604, 2106 ms) Web method response: [VersionControl/] QueryPendingSets[Ver] 18 ms 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 2106 ms) FileUploader.BeginUploadFile localFileName: C:\Manifests\ManifestStore\Dev01.xml 9/26/2006 3:19:18 PM (pid 5544, tid 4540, 2106 ms) Begin upload [id=0] C:\Manifests\ManifestStore\Dev01.xml 9/26/2006 3:19:18 PM (pid 5544, tid 4540, 2106 ms) Web method running: [http://xxxxxxx01:8080/] Ver-Upload: Dev01.xml 9/26/2006 3:19:18 PM (pid 5544, tid 4540, 2106 ms) Upload MD5 calc id = 0: 1805 bytes in 0 ms 9/26/2006 3:19:18 PM (pid 5544, tid 4540, 2106 ms) Upload id = 0 useCompression = True 9/26/2006 3:19:18 PM (pid 5544, tid 4540, 2106 ms) Time spent getting service URL Upload: 0 ms 9/26/2006 3:19:18 PM (pid 5544, tid 4540, 2106 ms) CreateWebRequest() -- Uri: http://xxxxxxx01:8080/VersionControl/v1.0/upload.asmx 9/26/2006 3:19:18 PM (pid 5544, tid 4540, 2122 ms) HTTP headers: Content-Length: 83 Content-Type: text/html Date: Tue, 26 Sep 2006 19:19:14 GMT Server: Microsoft-IIS/6.0 WWW-Authenticate: NTLM X-Powered-By: ASP.NET
9/26/2006 3:19:18 PM (pid 5544, tid 4540, 2122 ms) Completed upload: id = 0 in 20 ms, active = 1 9/26/2006 3:19:18 PM (pid 5544, tid 4540, 2122 ms) Web method response: [http://xxxxxxx01:8080/] Ver-Upload: Dev01.xml 20 ms 9/26/2006 3:19:18 PM (pid 5544, tid 4540, 2122 ms) Recorded m_exception in UpDownAsyncResult.Completed(): Microsoft.TeamFoundation.VersionControl.Client.VersionControlException: C:\Manifests\ManifestStore\Dev01.xml: TF30063: You are not authorized to access Microsoft-IIS/6.0. ---> Microsoft.TeamFoundation.TeamFoundationServerUnauthorizedException: TF30063: You are not authorized to access Microsoft-IIS/6.0. at Microsoft.TeamFoundation.VersionControl.Client.FileUploader.HandleErrorResponse(HttpWebResponse response) --- End of inner exception stack trace --- at Microsoft.TeamFoundation.VersionControl.Client.FileUploader.UploadChunk(FileStream fileContentStream, Int64 end) at Microsoft.TeamFoundation.VersionControl.Client.FileUploader.UploadContent() 9/26/2006 3:19:18 PM (pid 5544, tid 4540, 2122 ms) AsyncUploadFileState.Completed -- caught and converted: Microsoft.TeamFoundation.VersionControl.Client.VersionControlException: C:\Manifests\ManifestStore\Dev01.xml: TF30063: You are not authorized to access Microsoft-IIS/6.0. ---> Microsoft.TeamFoundation.TeamFoundationServerUnauthorizedException: TF30063: You are not authorized to access Microsoft-IIS/6.0. at Microsoft.TeamFoundation.VersionControl.Client.FileUploader.HandleErrorResponse(HttpWebResponse response) --- End of inner exception stack trace --- at Microsoft.TeamFoundation.VersionControl.Client.Workspace.EndUploadFile(IAsyncResult asyncResult) at Microsoft.TeamFoundation.VersionControl.Client.Workspace.AsyncUploadFileState.Completed(IAsyncResult asyncResult) 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 2122 ms) Total UploadFiles: 21 ms 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 2122 ms) Cumulative stats: Bytes uncompressed = 1805, Bytes compressed = 708, Compression = 60% 9/26/2006 3:19:18 PM (pid 5544, tid 5604, 2122 ms) Using cache file path C:\Documents and Settings\xxxxxxxx\Local Settings\Application Data\Microsoft\Team Foundation\1.0\Cache\VersionControl.config
Thanks
Sriman
|