Wednesday, September 12, 2007

How to: Undo an orphan checkout in VSTS

Recently, I replaced my old laptop with a new one. When I recreated the VSTS folder structure on the new laptop, I realized that I had forgotten to check-in a few files which I had checked out on my old laptop. How do I undo the checkout? That was the question bothering me… The solution, it turns out, is pretty straightforward.

Delete the workspace by using the command below

tf workspace /delete workspacename;username /server:servername

You will see the message below

A deleted workspace cannot be recovered.
Workspace 'workspacename;username' on server 'servername' has n pending change(s).
Are you sure you want to delete the workspace? (Yes/No)

Confirm the action and the problem is fixed!

Use the right words!

I have often observed project teams use the terms “task”, “action item” and “issue”. It is important to have an awareness of the distinction between these 3 terms, especially if you are a project manager.
Task: Refers to a unit of work planned as a part of a milestone deliverable. eg: Write a SharePoint web part to display search results.

Action Item: Refers to an activity or errand that is an outcome of a meeting and it should not ideally affect the project deliverables. An action item will always be associated either with the completion of a task or resolution of an issue. eg: Procure hardware for testing.

Issue: Refers to a hurdle that prevents progress of a task or impacts decision making. Generally, project risks morph into issues if not mitigated. Issues can impact project timelines and deliverables.eg: Bug in Third-Party APIs that has halted your work.

Tuesday, September 11, 2007

How to fix SharePoint error: Cannot complete this action

While my team was working on customizing a SharePoint site, we encountered the following error message

Cannot complete this actionEvent message: An unhandled exception has occurred. Process information:
Process ID: 1964
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
Exception information:
Exception type: SPException
Exception message: Cannot complete this action. Please try again.
Thread information:
Thread ID: 6
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at
Microsoft.SharePoint.Library.SPRequest.GetListItemDataWithCallback(String bstrUrl,
String bstrListName, String bstrViewName, String bstrViewXml,
SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback,
ISPDataCallback pPagingCallback, ISPDataCallback pSchemaCallback) at Microsoft.SharePoint.SPListItemCollection.EnsureListItemsData() at Microsoft.SharePoint.SPListItemCollection.get_Count() at ProjectCreation.ProjectCreation1.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.WebControls.WebParts.WebPart.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

This information was hardly of any use in fixing the issue. We discovered the precise information in the SharePoint log files in%Program Files%\Common Files\Microsoft Shared\web server extensions\12\LOGS.

Given below is the message logged when the error was encountered.
Failed to find tag corresponding to ID "112", tried both onet.xml for site definition ID "1" language "1033" and global site definition. Operation failed.

Further investigation revealed that in the process of customizing the site, the team had overwritten the global version of ONET.xml file(218 KB) witha version that was 17 KB in size and it did not have ListTemplate tag. Replacing it with the original file resolved the issue.

Monday, September 10, 2007

RegAsm : warning RA0000 : No types were registered

I was trying my hands at creating a .NET 2.0 component that can be consumed by a COM application.
One of the errors I got in the process of registering the .NET assembly was
RegAsm : warning RA0000 : No types were registered.

This was baffling!! I had done everything right and spent quite some time figuring out what could have gone wrong... until I had a look at the AssemblyInfo.cs. The ComVisible property for the assembly was set to false!! To access types in a .NET assembly from COM, this property should be set to true. Once I did it, I was able to successfully register the .NET assembly and consume it in my COM component. Be sure to remember this when developing COM - .NET interop applications!!

Rebuilding Perfmon counters on XP

Perfmon is an extremely handy utility to track application performance. When tracing the performance of .NET applications(VSTO/IBF) on the Office platform, I find the counter counter "# of Stubs" provided by the performance object ".NET CLR Interop" very useful. This counter displays the count of RCWs created by the CLR.

I wanted to use this counter on my XP box, but when I opened Perfmon, I could only see a list of random numbers in the Performance Object drop down box! The fix for this has been documented in KB300956. However, the steps in the KB did not help me. It was this discussion on the Channel9 forum that helped me restore the Perfmon counters. I stumbled on this link after a lot of searching, so thought of posting it here for future reference. Also, having submitted a feedback to Microsoft Support, I hope the KB article will be updated someday! :)

What is success?

The journey of life takes us through varied experiences like landing an admission at a prestigious college, earning a degree, getting hired,...