by Jim
Jul 30, 2010 1:26 PM
Our IT guy recently deleted my domain account (because in Exchange 2010 “delete mailbox” really means “delete mailbox and domain account,” but that’s a whole unrelated story.)
One of the results of this fiasco for me was an orphaned workspace on Team Foundation Server, for my old account, which prevented me from mapping folders in source control with my new domain account.

“The working folder is already in use by the workspace…”
The solution to this problem is to delete the cached workspaces on the TFS Server. This is done with the tf command-line utility.
Start by displaying workspaces for all users:
tf workspaces /collection:http://myserver:8080/tfs/CollectionName /owner:*
Or just on the local machine:
tf workspaces
/collection:http://myserver:8080/tfs/CollectionName
/owner:* /computer:MYCOMPUTER
Then delete the problem workspace from the server. In my case it’s the old domain account with “:4” appended to the end, which differentiates it from the new account. The full designation for the the workspace is COMPUTER;DOMAIN\username.
tf workspace /delete /collection:http://myserver:8080/tfs/CollectionName MYCOMPUTER;DOMAINNAME\username:4
This last action requires administrative permissions on the server.
by Jim
Aug 18, 2009 2:14 PM
I got some nasty malware yesterday. It restarted my machine, and my user account started rebooting shortly after logging in. Read on for the fix…
I was able to log in as administrator, or in safe mode. Sometimes, right before the restart, I would see a message from Windows Sidebar indicating a problem – something along the lines of, “Windows Sidebar experienced a problem with the following gadgets…”
I guessed that the problem was an IE add-on that restarted the computer as soon as the Internet Explorer process loaded.
The first step was to prevent the sidebar from running the Internet Explorer process. I did this by removing all the gadgets from the sidebar. From the administrator account, I deleted all files in
Jim\Local\Microsoft\Windows Sidebar\Gadgets folder
where ‘Jim’ is my non-admin user account that was experiencing the reboots.
This allowed me to log into the Jim account and not get an immediate reboot. I clicked on the IE icon, and sure enough, it logged me off and restarted the machine.
To prevent IE from running add-ons, I opened regedit and changed the setting from there, as described here:
[HKEY_CURRENT_USER]\Software\Microsoft\Internet Explorer\Main\Enable Browser Extensions
I changed this value to “no”, and IE started without rebooting the computer.
by Jim
Jul 01, 2009 2:12 PM
I’ve occasionally seen this helpful exception message:
An unspecified error occurred on the render thread.
…emanating from the curiously-named framework method NotifyPartitionIsZombie. After much scratching of the head and fruitless searching of the web, I finally found a reproducible case and computer (this appears to happen only with particular video cards.)

That allowed me to track down this little bug in my code. I wonder if infinitely large drawing objects are going to be a problem?
Fixing this bug prevented the exception.
I can’t prove this, but my theory is that different video card drivers have different ways of handling infinitely large objects, when told to draw them. Or vanishingly small ones – I’ve seen this in that situation as well. Some drivers appear to make a stab at drawing these things, or simply ignore them, while others throw an exception.
So if you’re getting the NotifyPartitionIsZombie exception, you might try checking that you aren’t drawing something with impossible dimensions.
by Jim
Jan 13, 2009 1:39 PM
I was getting this nasty error during the parsing of my XAML:
Failed object initialization (ISupportInitialize.EndInit). Value cannot be null.
Parameter name: element Error at object 'System.Windows.Controls.ComboBox' in markup file. . .
After (too) much digging around I figured that my selection changed event was being invoked during the parsing of the XAML (which seems a little weird.) As part of the logic in this handler, I’m using VisualTreeHelper to find elements in item templates. And VisualTreeHelper apparently does not like being used on half-parsed XAML.
The solution is easy enough; jump out if the XAML isn’t loaded yet.
private void ListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (!this.IsLoaded)
return;
And put a check at the top of FindVisualChild to make this easier to debug in the future.
private T FindVisualChild<T>(DependencyObject obj) where T : DependencyObject {
if (!this.IsLoaded)
throw new InvalidOperationException("Don't call this during loading, it might fail");
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(obj); i++)
{
DependencyObject child = VisualTreeHelper.GetChild(obj, i);
if (child != null && child is T)
return (T)child;
else {
T childOfChild = FindVisualChild<T>(child);
if (childOfChild != null)
return childOfChild;
}
}
return null;
}
by Jim
Dec 18, 2008 1:40 PM
When copying Microsoft’s default templates for WPF controls, you might run into some unresolved tags:
<Trigger.Value> <s:Boolean>False</s:Boolean> </Trigger.Value>
Where are that s:Boolean and the other ‘s’ prefixed tags thing comming from? They're in the System namespace; just add the prefix to your file like so:
xmlns:s="clr-namespace:System;assembly=mscorlib"
and you’re good to go!