Print Spooler error in Windows 7 (Bootcamp)

I found this blog post, which solved my problem regarding being unable to print on my Windows 7 MacBook Pro 13″ using Bootcamp.

http://tomgee.us/?p=172

This is from the original blog post (thanks to Tom Gee):

——————————————————–

The problem

Today, when I booted directly into my Windows 7 partition (not via VMWare), I noticed that I couldn’t print anything anymore.

I checked the Event Viewer and found the following error in the System log:
The Print Spooler service terminated unexpectedly.

In the Application section of the Event Viewer, I found the following:

Faulting application name: spoolsv.exe, version: 6.1.7600.16385, time stamp: 0×4a5bd3d1
Faulting module name: TPVMMon.dll, version: 2.0.51.5, time stamp: 0×48359080
Exception code: 0xc0000005
Fault offset: 0×000000000000846e
Faulting process id: 0×1300
Faulting application start time: 0×01caa2aa2c4394d8
Faulting application path: C:\Windows\System32\spoolsv.exe
Faulting module path: C:\Windows\System32\TPVMMon.dll
Report Id: 7188e318-0e9d-11df-9123-895fd79b6e49
Faulting application name: spoolsv.exe, version: 6.1.7600.16385, time stamp: 0×4a5bd3d1Faulting module name: TPVMMon.dll, version: 2.0.51.5, time stamp: 0×48359080Exception code: 0xc0000005Fault offset: 0×000000000000846eFaulting process id: 0×1300Faulting application start time: 0×01caa2aa2c4394d8Faulting application path: C:\Windows\System32\spoolsv.exeFaulting module path: C:\Windows\System32\TPVMMon.dllReport Id: 7188e318-0e9d-11df-9123-895fd79b6e49

The only thing I could attribute the Print Spooler issue to was VMWare Fusion.

I tried uninstalling the VMWare Tools program listed in the Control Panel > Uninstall Program section, but it would not remove.

No errors were displayed, but the program wouldn’t remove from the Programs list.

The solution

I deleted the following folder (and all related subkeys) from the Registry (via Start > Run > regedit):

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Print\Monitors\ThinPrint Print Port Monitor for VMWare]

.NET Resource localization

ResourceBlender is open source and works for .NET:

http://www.resourceblender.com/

IETester 0.4.2

Usually when I need to test a HTML design, I use Spoon browsers… but I saw this IE Tester 0.4.2 tool.

This is just to remind me, don’t install, it made the JavaScript of Gmail and other sites fail.

So, stick to Spoon, don’t use IETester 0.4.2.

Posted in Development, Software. Tags: , . No Comments »

Visual Studio 2008 debugging and breakpoints

My development tools are currently Visual Studio 2008, Resharper 4.5, Gallio and Testdriven.NET. But for as long as I have used these tools, my Visual Studio debugger has only worked partly.

The problem

When I inserted some breakpoints in my code, the first one was almost all the time hit. However, when I tried to step through the code, it worked fine for a bout 3-6 steps. But then Visual Studio debugger decided that was enough, and just completed the code.

The good thing was, it forced me to write many unit test cases, but sometimes I really think it is nice to visually see the state of your objects, in the code.

I have spoken to colleagues, and tested with different combinations of Gallio, Testdriven.NET and Re-sharper enabled, as I thought they cased the problem. But the debugger just kept bugging me. I had actually given up finding a solution to this problem, thinking that Visual Studio 2010 would fix it.

The solution

So finally, in a complete other context, I stumbled upon this page:

http://code.msdn.microsoft.com/KB957912

And thought…. that title sounds interesting… I quickly moved to the KB article, and started to read. I thought, that sounds exactly as my problem.

With nothing to loose I installed the update, and started to test the debugger… until now it seems to work :)

- please note, I do not use the debugger that often as I write very reliable code :)

Test of online backup providers

I have a Windows server that I use as a development and testing server. Besides that it also hosts my Subversion repository.

Being a developer, my subversion repository is of great value to me. I have therefor been looking for different online backup providers. My requirements are:

  • Must run in a Windows server environment
  • Preferably free or rather cheap
  • Must run autonomously
  • 2-3 GB of space
  • Secure
  • Low frequency of errors

Dropbox

Dropbox provides you with a 2GB free account and works both for Windows and Mac. However it only supports backing/synchronizing one folder.

SugarSync

SugarSync is actually ok and has a nice IPhone app. They provide a 2GB free plan, and I am currently using them in another context. However, they are a bit pricy compared to others.

IDrive

They also provides you with a 2GB free plan. They work alright and have some friendly support people, however their Windows application seems buggy. I have tested the application on 3 different Windows machines, and at first everything works fine… but at some point the software just stops backing up. It seems like the schedule part is broken.

The free plan can also be used on Windows server versions, which is nice.

Mozy

Mozy provides, like the rest, a 2 GB free plan. The software works fine, however not on Windows server versions.

Another thing to note is, if you need to backup a large number of files then Mozy will consume a large portion of you memory accordingly. I have experienced Mozy consuming 400-450 MB of ram.

Memopal

After testing the other providers I found Memopal. They provide a 3GB free account, which is more than the others. Their application runs among others on Mac, Linux and Windows, including a server environment.

As Memopal initially almost satisfies all of my requirements, I was hopeful :) Unfortunately Memopal would not back files up larger than 20MB, as their limit should be 5GB per file, it must be some kind of error with the software. All the smaller files were backup without problems.

As I was backing my Subversion server files up some directories are just called “0″, “1″, “2″ etc. it looks like Memopal does not support these folder names, I was not able to retrieve these folders from their web interface.

Conclusion

So this leaves me with nothing… or I am settling with IDrive and hoping that the errors in the software will be fixed. But I will keep looking for a good and reliable online backup software.

iVPN on Mac OSX 10.4 (Tiger)

iVPN application

I have a Mac mini with Mac OSX 10.4 (Tiger), and I wanted to use this as my home server. Some kind of VPN server was required to give me external access to my files.    

I first read abut iVPN, but I was looking for a free service. I then looked into Hamachi (It looks like LogMeIn har purchased the rights to this software) (HamachiX).    

Hamachi

As I understand it, Hamachi was free and multi platform until LogMeIn took over. LogMeIn currently only support Windows, but I needed both Mac and Windows to work toghether.    

I then got the latest HamachiX and the free LogMeIn Hamachi2 to work, but the connection kept being dropped after some time. I think it is because HamachiX is based on a legacy version of Hamachi, and LogMeIn Hamachi2 is based on a newer version, and as I do not want to keep loosing my VPN connection, I dropped the idea of Hamachi.    

iVPN

Starting from scratch I started to read about other VPN solutions and servers for the client version of Mac OSX. This post explained that a PPTP and L2TP VPN server had been part of all Mac OS since 10.2. It was just not mentioned by Apple nor supported.    

This build in VPN server is what iVPN uses (read more in this post), a configuration tool that until version 2.4 was free, but now is commercialware. But as this tool does nothing but configuration, you can download the 2.4 beta version  here (iVPN 2.4b).    

Configuring the VPN server

As I needed Windows clients to access my Mac mini and due to my current network setup, I chose PPTP as VPN protocol.  The following steps explains what I did to setup the VPN server on Mac OSX 10.4.   

  1. Download iVPN-2.4b  (If you need here is the iVPN 2.4b manual and the iVPN 2.4b source)
  2. Run the iVPN
  3. Click no to the upgrade
  4. Enable the PPTP and disable the L2TP protocol (or enable/disable the protocol you wish to use)
  5. Type in a username and password
    1. Do NOT use spaces in the username…
    2. If you have chosen to use L2TP then write a “shared secret”
  6. Type in a IP address range, but make sure it does not conflict with your existing DHCP server setup.
  7. The router is the default gateway and the subnet mask, normally you would use 255.255.255.0
  8. I used the OpenDNS for DNS resolution.
  9. Check the “Start server at boot time”.
  10. Then click the “On” button.
  11. Type in the administration password if required to.
  12. Close iVPN
iVPN user interface

iVPN application

 

Firewall

Now the VPN server is setup, now you need to open for port 1723 in the firewall.    

  1. Open the System preferences in Mac OSX.
  2. Click “Sharing” under “Internet & network”
  3. Open the “Firewall” tab
  4. Click new
  5. Select other in the “Port name” and write 1723 in the TCP port
  6. As description write PPTP, VPN server or something else
  7. Click ok and then you should be ready Mac OSX wise.

Mac OSX PPTP firewall    

Now the only thing left is to open port 1723 in your router. If you have trouble doing that, look into the manual of your router or call the support hotline of your ISP.

NHibernate Fluent Criteria

– Updated on the 2. January 2010

I have been using NHibernate for some time now, and I am very satisfied with the functionality it provides. However, I do really not like “magic strings” as these makes the code resistent to refactoring.

NHibernate makes use of “magic strings” when doing a query using HQL or the Criteria API. I tend to use the Criteria API as this, opposed to HQL, limits the logic encompassed in “magic strings”.

As I mostly use the Criteria API, I thought, why not do something about it :)  So I did. Very quickly a Fluent Criteria interface was implemented. Here is how it is used:

var email = "email@email.com";
var customerType = CustomerType.Default;

var result = nhSession.Criteria<Customer>()
             .Add.Equals(x => x.Email, email)
             .Add.Equals(x => x.Type, customerType)
             .Order.Desc(x => x.Created)
             .NHCriteria
                 .SetMaxResults(1)
                 .UniqueResult<Customer>();

In this line we call the extension method Criteria with Customer as a generic argument:

var result = nhSession.Criteria<Customer>()

By doing so we of the alternate Fluent Criteria API I have implemented. Currently it is only some of the Restrictions and Order classes that have been implemented, but you are free to use these classes and extend them as you wish.

By calling the NHCriteria property, you get the normal NHibernate criteria API, so here you can set the cache options, max results, etc.

Download the source code here http://ovesen.codeplex.com/wikipage?title=NHibernateFluentCriteria&referringTitle=Home

Happy New Year btw :)

Now using Wordpress

I have now changed my blog software from BlogEngine.NET to Wordpress. It was not very complicated to export my blog posts from BlogEngine.NET to Wordpress, however it did take some time to import everything to Wordpress. Here are the steps I had to do.

I used these two blog posts as inspiration (this by Merill and this by Paul).

Wordpress was installed and configured using Microsoft Web Platform, which makes installing PHP, MySql etc. very easy.

Step 1

From BlogEngine.NET. Export content to BlogML.

Step 2

Copy the files from “\App_Data\files” to “\wp-content\uploads”.

Step 3

Open the BlogML xml file in Visual Studio, Notepad or some other text editing program.

Step 4

Search the BlogML xml file for “.axd” then you will see that BlogEngine.NET uses some different axd files to reference images and other files. I searched for and replaced the following:

  • “/image.axd?picture=” → “/wp-content/uploads/archive/”
  • “/file.axd?file=” → “/wp-content/uploads/archive/”

Step 5

Download “PhpXPath-3.5” and put the file (XPath.class.php) in your “/wp-admin/” folder.

Step 6

Edit “/wp-admin/admin.php” and look for the line:

require_once(ABSPATH . 'wp-admin/includes/admin.php');

Add a line below it, so it looks like this:

require_once(ABSPATH . 'wp-admin/includes/admin.php');
require_once('XPath.class.php');

Step 7

Download the BlogML import to Wordpress tool, and upload the file (blogml.php) to your “/wp-admin/import” folder.

Step 8

Open your Wordpress Site Admin interface and go to Tools -> Import. You should now see a BlogML import link, click it, upload the BlogML file and you should be ready to go. At Least I was :)

BlogML import tool screenshot

Installing Vista x64 (and Boot camp 64bit) on an iMac

I have had some problems with my iMac and had to do a complete re-install.

My partition setup is a bit special, 3 partitions in total. I want Mac OS on the first partition, Vista 64bit on the second and Vista 32 bit on the last.

Installing Mac OS X is no problem, slide in the installation DVD fire up the Disk Utility (Do not install yet). Partition the disc as planned (remember to choose GPT as partitioning system). The first partition should be the suggested Mac, the two nest should be MS-DOS FAT (Don't worry, we will reformat to NTFS later).

Install Mac OSX.

After that, put the Vista x64 installation DVD in the drive and initiate that installation. There should not be any real problems in this.

Finish the first Vista installation and boot up. Now we need to install the Boot Camp 64bit 2.1, and this can be a bit of a problem. The problem is, the Boot camp software on the Mac OS X DVDs are not compatible with Vista 64bit on an iMac. I then downloaded the updated Boot Camp 2.1 for Vista 64. Unfortunately this is an update, requiring an earlier version, which we cannot install. Read more about that here: http://www.iotashan.com/index.php/2008/07/06/install-vista-x64-sp1-under-bootcamp/

But do the following and you should be home safe:

  1. Download Boot Camp Update 2.1 for Windows Vista 64
    http://www.apple.com/downloads/macosx/apple/application_updates/bootcampupdate21forwindowsvista64.html
  2. Install an older version of Boot Camp from the installation DVDs (I used Leopard 10.5 update disc)
  3. Run the downloaded Boot Camp 2.1 64bit update
  4. If you encounter the problem "Error applying transforms. Verify that the specified transform paths are valid."
    The system is trying to tell you (I think) that you are installing a software that is using another culture/language than your system.
    Read more about resolving this issue here or find a short version below:
    http://www.tiagodherbe.eu/Page/3191/articleType/ArticleView/ArticleID/118/Home.aspx
  5. Now try the install again.

This worked for me.

Fixing "Error applying…"

1. Start the Registry editor
2. Go to this key (or search for Boot Camp): {HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\1972E1D59AAA4FE4B9DA97EEB1F70D04}
3. Change language to 409 (1033, the culture/language of the installation)
4. Try the install again

Posted in Software. Tags: , , , . No Comments »

Locked out of MSSQL 2008

Have you lost administration control of your MSSQL 2008?

I lost control of my MSSQL 2008, unable to create new databases and change server settings… pretty annoying.

I think it happened because I upgraded from SQL Express 2005 to 2008. 

Well if you have the same problems, then you can either uninstall and then install the SQL Server 2008 again… or you can do as me :)

Before you start, make sure the current user is member of the administrators group.

  1. Shutdown the SQL server service, agent service, browser service etc.
  2. Open a Command prompt
  3. Navigate to the SQL 2008 installation directory. E.g.:
    "C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Binn"
  4. Run "sqlservr -m -sSQLEXPRESS" (SQLEXPRESS should be the name of your instance)
  5. The SQL server should now be started in "Single User admin mode".
  6. Open "SQL Server Management Studio", remember, if you use Vista, to run as administrator.
  7. Open your instance and change your user to sysadmin.
  8. Close "SQL Server Management Studio"
  9. Goto the command prompt and shut down the SQL server instance (press CTRL-C, I think)
  10. Start the SQL service again

 

You should now be able to create databases again.