Last post Mar 16, 2007 12:21 PM by Brian@Planet
Mar 14, 2007 04:40 AM|lagu2653|LINK
In the VS2005 SDK there's an example project for a web client work item browser application. Would it be possible to create such a web client as an ASP.NET web part? How would you do that? I've made an application that enters work items into TFS but when
I put the same code into the web part ascx.cs file it won't work. When I press the button in IE7 I'm taken to an error page. They just tell me that something is wrong, not what is wrong, and I don't know how to debug it. It's a web part on a Sharepoint 2.0
page. I can't press F5 cause the file is on the server and not on my PC. It's a Sharepoint page which contains a SmartPart web part which contains my ascx web user control.
Thankful for any help, Lars
Mar 14, 2007 12:22 PM|Brian@Planet|LINK
Well, I've not looked into what your trying to do but I can help you with the debugging issue. Debugging any web based project is pretty much the same, first run the page, to start the thread. In VS2005 with your project loaded and set your break points.
Click on Debug > Attach To Process. This will open the Attach To Process window. Find the w3wp.exe process and click on it then click Attach. This is assuming your code, VS2005 and WSS are all on the same box. Otherwise you have to hit the help file about
setting up remote debugging.
Also, you can check the WSS logs in c:\program files\common files\microsoft shared\web server extensions\12\logs. Look for the latest log file and it may shed some light on why your web part is failing. Note that these log files grow pretty fast so the
sooner you look after you try the web part the better. I've noticed that they are updated even when I'm not doing anything with WSS by some of the background processes.
I would also check the Application event log to see if there are any clues there.
Mar 15, 2007 12:43 PM|lagu2653|LINK
This is the error message:
Event Type: Error
Event Source: Windows SharePoint Services 2.0
Event Category: Devices
Event ID: 1000
Requested registry access is not allowed.
For more information, see Help and Support Center at
Here's what I'm trying to do: (When the button in the web part is clicked the
Button1_Click is called)
// TestWebUserControl.ascx.cs I'm using the SonOfSmartPart web part to host my ascx control. (WSS 2.0 so FrontPage server extensions are not allowed)
testWUC : System.Web.UI.UserControl
protected void Page_Load(object sender,
protected void Button1_Click(object sender,
"SCS3 Diagnostic", "New Task",
"3333333 33333333 33333333.", "larsg");
catch (Exception ex)
Response.Write("-------> " + ex.Message +
public void CreateWorkItem(string server,
string projectName, string title,
string description, string owner)
// En del saker skapas antagligen automatiskt när man lägger till ett nytt work item
TeamFoundationServer tfs =
WorkItemStore store = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));
WorkItemTypeCollection workItemTypes = store.Projects[projectName].WorkItemTypes;
WorkItemType wit = workItemTypes["task"];
WorkItem workItem =
workItem.Title = title;
workItem.Description = description;
workItem.Fields["System.AssignedTo"].Value = owner;
//workItem.CreatedBy = "larsg";
//workItem.Reason = "From Customer";
Mar 16, 2007 12:21 PM|Brian@Planet|LINK
Ok, your error does tell me what line is failing so I've had to do some intense research here but from what I can find it may be failing on the TFS .GetServer call. So on the WSS box ensure that this key: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\TeamFoundation\Servers
exists and if you view the security that the logged on user account or the identity of the app pool on which the web application this web part is running under has rights to read the key.
You may also need to specify credentials
System.Net.ICredentials teamFoundationCredential = System.Net.CredentialCache.DefaultCredentials;
TeamFoundationServer tfs =
Look into those two items and see how it goes.