Monday, July 20, 2009

NHibernate and Oracle 9i

Spent 1.5 hours troubleshooting the following error when using NHibernate 2.1:

"NHibernate.HibernateException: Could not instantiate dialect class NHibernate.Dialect.Oracle9Dialect ---> System.TypeLoadException: Could not load type NHibernate.Dialect.Oracle9Dialect. Possible cause: no assembly name specified."

I was looking at outdated documentation. The correct dialect is "NHibernate.Dialect.Oracle9iDialect" (emphasis mine). "NHibernate.Dialect.Oracle10gDialect" is also valid.

Friday, April 24, 2009

The Case of the Disappearing Drive

I made a big mistake recently when reinstalling Windows XP Professional SP3- I didn't disconnect my secondary hard drive. After installation was complete the second hard drive appeared as unallocated space in Disk Management. The NTFS-formatted disk had plenty of stuff on it. Well, it did prior to my lapse in judgment. TestDisk saved me. Great tool. These two tutorials (thanks Herman!) walked me though recovering my partition, which obviously I had blown away during the XP install process. I had to actually use the dig deeper method to get my partition back.

Friday, April 3, 2009

VS2008 WPF Intellisense no longer works after SDK install

Another in the "note to self" series...

Intellisense stopped working for VS2008 WPF projects after installing the .NET 3.5 SDK. Resolution is here. This fixed my problem without a machine reboot.

Tuesday, March 31, 2009

Determine installed MS hotfixes

This is really just a note to self.

Enter wmic qfe list full /format:htable >C:\hotfixes.htm on the command line.

Wednesday, February 25, 2009

Error while installing Systems Management Server 2003 Service Pack 3 on Windows Vista

I hope that this saves someone some time.

If your attempt to install SMS SP3 on Windows Vista fails with the message "not enough storage to process this command" then follow the steps enumerated in this support article.

Monday, January 12, 2009

FreeNAS Server

Built a network-attached storage server using FreeNAS and a Dell OptiPlex 280 based on this guide from Maximum PC. Setup was unbelievably easy and the machine works great. The only problem I ran into was creating my shares. This post helped me understand the configuration required.

Friday, January 2, 2009

Editing multiple VS2008 solution files with PowerShell

Our huge LOB application is comprised of 30+ Visual Studio 2008 projects. One of these projects, which I'll call the 'Framework', is used as a reference by many of the projects. We use several different solution files comprised of a subset of the 30+ projects in order to improve Visual Studio performance as well as reduce Solution Explorer visual clutter.

I recently needed to move the Framework project to a new location in Team Foundation Version Control (TFVC). This move meant that some of the solution files needed to be altered because the TFVC references inside the file would now be invalid. Specifically, the SccProjectNameNN reference needed to be altered, where NN is the ordinal value of the project reference in the solution file.

Doing this in Visual Studio would be extremely tedious because each solution file would have to be opened, remove the invalid Framework project(which would also cause the reference to be automatically removed from the other projects in the solution), add the valid Framework project reference back to the solution, and add the Framework project reference back to each affected project. Time was also a factor. I didn't want to hold up developers by having solution and project files checked out. We allow shared checkouts, but I was concerned about developer TFS workspaces if I made any mistakes.

Recently I had used Powershell to alter reference paths in a Visual Studio project file. Could I do the same with the solution files? (Hint: Yes, I could.)


PS H:\> $projectLocation = "C:\Workspace"
PS H:\> $files = get-childitem $projectLocation -include *.*sln -recurse
| Select-String -pattern "/OldVersionControl" -SimpleMatch
| Select-Object -Property Path
PS H:\> $files | Foreach-Object { CheckOutTfsFile( $_.Path) }
PS H:\> $match = "/OldVersionControl"
PS H:\> $replacement = "/NewVersionControl"
PS H:\> $files
| Foreach-Object { (Get-Content -Path $_.Path -encoding UTF8 )
-replace $match, $replacement | Set-Content $_.Path -encoding UTF8 }


As you can see there's no real magic here- just a simple replace operation inside each file that has content that matches '/OldVersionControl'. The pipeline allowed me to avoid the dreaded manual tediousness of updating multiple solution files.