Vista Sleep Problem Solved?

I decided to check on the state of Vista fixes last night by installing the latest updates from Windows Update and the latest NVidia drivers.  Unfortunately, my system would still hang when waking from its second slumber.  These kinds of sleep problems with Vista are widely reported on blogs and discussion forums all over the Internet, so I thought I’d post about what appears to fix the problem for me.

I don’t know what made me think to do this, and I think I’ve tried this in the past, but I disabled hybrid sleep (Control Panel, Power Options, Change plan settings, Change advanced power settings, expand Sleep, expand Allow hybrid sleep, change setting to Off, click OK).  Now my PC wakes from sleep every time!

Hybrid sleep is new in Windows Vista and is a cross between the old "standby" mode and "hibernation".  Standby works by powering down just about everything except the RAM, which saves the machine’s state so that it can very quickly resume where you left off when you power it up again.  Hibernation saves the computer’s state to the hard drive and powers down completely.  Resuming from standby is many times faster than resuming from hibernation, since loading the state back from the hard drive takes some time.  Windows Vista’s hybrid sleep mode saves the state to the hard disk but then goes into standby mode, keeping the state in RAM as well.  The idea here is that the state is protected in case the power is lost to the PC (which would wipe out the state in RAM), but most of the time the machine wakes up quickly by using the state stored in RAM.

I don’t know what it is about my hardware that is preventing a wake from hybrid sleep and not "plain old standby" mode.  I have a UPS connected to this machine, so I’m not particularly concerned about it losing power while it’s sleeping.  XP only supports standby and hibernation and that had been working without and problems, so that may be what finally made me think to disable hybrid sleep. 

So now I think I’m going to give Vista another chance.  At least until I run into the next show stopper…

NVIDIA to Blame for my Vista Woes?

About a month ago, news spread that NVIDIA drivers were to blame for nearly 30% of all Vista crashes in 2007.

I’ve also seen folks report problems resuming from sleep mode that have NVIDIA graphics chips running VISTA. Exactly the problem I’ve been having.

The Asus motherboard I’m using not only has an NVIDIA video chip, but also the nForce chipset. So, it seems very likely that I unknowingly picked the wrong motherboard when I built my first Vista system. Will NVIDIA ever fix their drivers for VISTA or am I going to have to stay with XP until I build my next system? I’ll probably think twice before choosing NVIDIA in the future…

XP SP3: Evil Plot to Get Me to Switch Back to Vista?

I grabbed Service Pack 3 for Windows XP from MSDN and nearly hosed up my machine tonight.

After backing up my drive, I installed SP3.  Once the installation finished, it wanted to reboot the system (of course).  Problem was, it wouldn’t start back up.  It just hung there on the Windows XP logo screen  with the "progress bar" going around and around forever.  I reset the box and tried again.  This is standard operating procedure with Windows – sometimes just trying something again works.  But not this time.

Fortunately, I could still boot into safe mode and uninstall SP3.  After that, everything returned to normal.  So now, I’m left wondering if I’m going to be stuck at SP2 on this machine and unable to get future security updates.  Is this Microsoft’s way of getting me to try Vista again?  At least under Vista things sort of worked and I could get updates.

Maybe it’s time to reconsider getting a Mac.

UPDATE: 5/10/08 – Installed SP3 via Microsoft Update with no problems. Mac purchase delayed for now. 🙂

JScript.NET

From the things I didn’t know department comes JScript.NET.  What is JScript.NET?  In a nutshell, it’s a .NET version of JScript, i.e. a .NET version of JavaScript!  Why should you care about JScript.NET?  Well, here’s a scenario I had recently:

The company I work for uses Nagios to monitor it’s mission critical systems.  One common use is to simulate a user logging into a web application by POSTing credentials to a login form and checking for specific strings in the response.  This usually gives you an end-to-end check that all systems (web server, database server, etc.) related to the app are functioning.

I was asked to investigate how we could monitor one app in particular that couldn’t be checked with the simple tools included with Nagios.  This application was encrypting the user’s password two different ways using JavaScript before submitting it to the server.  To make matters worse, it was using a random key generated by the server each time the login page was opened.

Since I’m primarily a .NET developer and have very little experience with *NIX systems and PERL (most Nagios plug-ins are written in PERL), my approach was to build a simple web page that Nagios could check that would act as a proxy to this particular app.  This still left me with the problem of how to simulate what the browser was doing in JavaScript. 

One solution would be to translate the JavaScript to C#.  Another would be to try to host the Windows scripting engine in my .NET app and invoke the existing scripts as-is.  Or maybe I could write a "classic" ASP page using JScript.  None of these options appealed to me much, so I consulted Google.

I eventually came across JScript.NET.  I knew about J# (Microsoft’s attempt to lure Java programmers to the .NET platform), but what the heck is JScript.NET?  When I create a new project in Visual Studio, there’s no JScript options…

Hidden away in the .NET SDK is jsc.exe, the JScript.NET compiler.  So, now it was just a matter of taking the JavaScript code I wanted to use from C# and compiling it using jsc /t:library <source file> and I had a DLL I could reference and call.  A few minor tweaks were needed, like wrapping stuff in a class, but overall it was pretty painless and it worked!

Not sure if I’ll ever need to do something like this again, but it’s nice to know JScript.NET is there…

Enough is Enough

Windows Vista caused me to have a Samuel L. Jackson moment a couple of weeks ago.

samuellj

I installed SP1 with high hopes of it fixing the things about Vista that have been driving me nuts for almost a year.  Namely:

  • Random application crashes, including Windows Explorer
  • The inability to wake up using the network card with Virtual PC installed (can work around by disabling Virtual Machine Network Services, but then VMs have no connectivity)
  • And worst of all, Vista won’t wake up at all after being put to sleep a second time.  It wakes up OK the first time, but the second attempt causes the fans and hard drive to spin up while the OS itself remains comatose.  No video, no hard drive activity, no sound, nothing.  It takes a reset to get it going again, totally defeating the purpose of sleep mode – especially when resuming from the hibernation file takes WAY longer than a clean boot.

So, after putting up with with this nonsense for nearly a year, Microsoft finally released Service Pack 1.  And guess what?  IT FIXES NONE OF THE ABOVE PROBLEMS.  The first time Vista SP1 would not wake from its slumber, I said enough is enough (among a few other phrases that I won’t repeat here) and "upgraded" to XP.  XP has none of the above problems ON THE SAME HARDWARE (which I purchased new with the intent of running Vista).  As a bonus, everything is noticeably faster.  This review of XP got it right.

Crash Course in VSTO

I’ve inherited yet another project at work. This latest one includes a series of reports all done in Excel with VBA macros. The code for these macros is almost unmaintainable, so I’m trying get these rewritten using Visual Studio Tools for Office (VSTO). This is my first experience with VSTO and right now I’m in the “proof of concept” stage, struggling with deploying a test case using ClickOnce.

So far, here’s what I’ve learned:

  • Visual Studio 2008 ships with VSTO “in the box”
  • There are several options, depending on if you want to target Office 2003, 2007, .NET 2.0, 3.0, 3.5
  • You can’t target 2007 specifically and use anything but .NET 3.5
  • Only .NET 3.5 supports deploying VSTO solutions using ClickOnce

As I write this, I’m testing using IIS 7 running under Vista (yes, I’m a glutton for punishment) for my publishing location and have Windows XP running under Virtual PC with Office 2003 for testing the deployment. So far I’ve had several attempts at getting the bootstrap to download and install .NET 3.5 and the VSTO runtime. To work around a couple of the problems I had to manually add application/octet-stream MIME types to IIS for the .MSP and .MSU files that are part of the .NET Framework redistributable.

Everything is downloading now, but the install failed with a “Status of package ‘.NET Framework 3.5’ after install is ‘InstallFailed'” in the installer log file. I’ll update this post once I get that figured out…

UPDATE: Rebooted the VPC and now the .NET Framework installed. Gotta love it.

UPDATE: Needed another MIME type set up for .vsto files: http://msdn2.microsoft.com/en-us/library/bb608629(VS.90).aspx

UPDATE: And after all of that, it doesn’t work with Excel 2003. I get the error: The common language runtime could not be loaded by Excel file path. Contact your administrator for further assistance. I thought maybe if I used the Office 2007 VSTO project template, but saved the Workbook using the 97-2003 compatible format I could open it in Excel 2007 or 2003. No such luck. Looks like if you want to use VSTO + ClickOnce, you have to target Office 2007 users…

Moved to GoDaddy.com Hosting

Moved this site to GoDaddy.com hosting this weekend from Brinkster. My rate with Brinkster was going up (I originally signed up during a 50% off sale) and they’ve annoyed me a few times when they would change things (breaking my site) with no notice. I’ve seen plenty of complaints about GoDaddy hosting around The Web, but I figured I’d try it myself for a couple months. And they’re CHEAP!

One of the first problems I had was getting this blog up and running. GoDaddy no longer officially supports PHP on their Windows hosting, but it is installed. I need PHP (for now) because this is a WordPress blog. I plan to eventually move to a .NET based blog, but I wanted to get moved over to GoDaddy fairly quickly.

The problem I had was getting connected to the MySQL database. GoDaddy provides either MySQL 4.1 or 5.0. The version of PHP installed on their Windows hosts is an older version and therefore, an older version of the MySQL client and it won’t connect to MySQL 4.1+ by default. After much Googling, I learned that the password hash in 4.1 and above has changed to a larger size that the older clients do not support. MySQL, however can still generate the older hashes for backward compatibility. The work around is to change your MySQL password using the following command:

set password = old_password(“yournewpassword”)

The “old_password” function generates the old-style password hash. This is less secure, but at least I’m up and running. As I said, I plan to move off WordPress anyway, so this is only temporary. You’d think GoDaddy would document this somewhere, but they appear to pretend that PHP on Windows hosting does not exist (and maybe it won’t someday – they tell you to use their Linux hosting if you want PHP). Hopefully, this helps someone else troubleshoot this problem someday…

Got Athlon? No Silverlight For You!

Bummer. We’ve got an older 1.4Ghz Athlon PC here in our family room and Silverlight does not run on this chip, according to this thread: http://silverlight.net/forums/t/5590.aspx

Someone should update the Silverlight system requirements, as there’s no mention of this. That page says all you need is a “X86 or x64 500-megahertz (MHz) or higher processor with 128-megabytes (MB) of RAM”. Apparently, Silverlight needs a processor that supports SSE instructions, witch the original Athlon chip lacks. AMD added that feature in the Athlon XP.