Scott Hanselman

FIXED: Blue Screen of Death (BSOD) 7E in HIDCLASS.SYS while installing Windows 7

June 8, '14 Comments [21] Posted in Bugs
Sponsored By

I was doing tech support for a friend this weekend. He was paving an old HP Envy laptop (although this happens on some Dell Inspirons as well) and was getting a blue screen in the middle of install. Then, of course, if you're not looking at it you'll just reboot and drop back into setup and get the "the computer restarted unexpectedly or encountered an unexpected error." At this point he was in a setup loop.

IMG_1519

"HIDCLASS.SYS" is the driver that failed. HID means Human Interface Device, and that means "keyboards or mice" for the most part.

IMG_1543

Errors in HIDCLASS.SYS, especially during setup, almost always means that there's trouble with an attached keyboard or attached mouse. I asked my buddy if he had a mouse attached and he did. He removed the mouse, and started setup over again. Setup succeeded. Then, he spent about an hour (and several reboots) getting Windows 7 "gold" (which was released in July of 2009, almost 5 years ago) up to date with patches, service pack 1, and the latest drivers. Then he was able to attach his mouse and it works fine.


Sponsor: Big thanks to Mindscape for joining us and sponsoring the blog feed this week! I discovered Raygun.io and started using it for my side project and I LOVE it. Get notified of your software’s bugs as they happen! Raygun.io has error tracking solutions for every major programming language and platform - Start a free trial in under a minute!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web

Fixing System.Core 2.0.5 FileLoadException, Portable Libraries and Windows XP support

May 8, '14 Comments [17] Posted in Bugs | Learning .NET | WPF
Sponsored By

Installing Windows XP to testMy buddy Greg and I are getting ready to launch our little side startup, and I was going through our product backlog. Our app consists of a global cloud service with Signalr, an iPhone app made with Xamarin tools, and a WPF app.

One of the items in our Trello backlog was "Support Windows XP. Gasp!"

I hadn't given this item much thought, but I figure it was worth a few hours look. If it was easy, why not, right?

Our WPF desktop application was written for .NET 4.5, which isn't supported on Windows XP.  I want to my app to support as basic and mainstream a .NET 4 installation as possible.

Could I change my app to target .NET 4 directly? I use the new async and await features extensively.

Well, of course, I remembered Microsoft released the Async Targeting Pack (Microsoft.Bcl.Async) through NuGet to do just this. In fact, if I was targeting .NET 3.5 I could use Omer Mor's AsyncBridge for .NET 3.5, so it's good that I have choices.

I changed my project to target .NET 4, rather than 4.5, installed these NuGets, and recompiled. No problem, right?

However, when I run my application on Windows XP it crashes immediately. Fortunately I have instrumented it with Raygun.io so all my crashes to to the cloud for analysis. It gives me this nice summary:

raygun.io is amazing 

Here's the important part:

FileLoadException: Could not load file or assembly 
'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes'
or one of its dependencies. The given assembly name or codebase was invalid.
(Exception from HRESULT: 0x80131047)

That's weird, I'm using .NET 4 which includes System.Core version 4.0. I can confirm what's in the GAC (Global Assembly Cache) with this command at the command line. Remember, your computer isn't a black box.

C:\>gacutil /l | find /i "system.core"
System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL
System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL

OK, so there isn't even a System.Core version 2.0.5 in the GAC. Turns out that System.Core 2.0.5 is the Portable Libraries version, meant to be used everywhere (that means, Silverlight, etc, everywhere) so they made the version number compatible.

Because we're building our iPhone app with Xamarin tools and we anticipate supporting other platforms, we use a Portable Library to share code. But, it seems that support for Portable Libraries were enabled on .NET 4 vanilla by the KB2468871 update.

I don't want to require any specific patch level or hotfixes. While this .NET 4 framework update was pushed to machines via Windows Update, for now I want to support the most basic install if I can. So if the issue is Portable Libraries (which I still want to use) then I'll want to bring those shared files in another way.

You can LINK source code in Visual Studio when you Add File by clicking the little dropdown and then Add as Link:

Adding source code as a Link within Visual Studio

Now my Messages.cs file is a link. See the little shortcut overlay in blue?

A linked file as a little overlay on the icon

I removed the project reference to the Portable Library for this WPF application and brought the code in this way. I'm still sharing core, but just not as a binary for this one application.

Recompile and redeploy and magically .NET 4 WPF application with async/await and MahApps.Metro styling starts up and runs wonderfully on this 12 year old OS with just .NET 4 installed.

For our application this means that my market just got opened up a little and now I can sell my product to the millions of pirated and forever unpatched Windows XP machines in the world. Which is a good thing.


Sponsor: Big thanks to Aspose for sponsoring the blog feed this week. Aspose.Total for .NET has all the APIs you need to create, manipulate and convert Microsoft Office documents and a host of other file formats in your applications. Curious? Start a free trial today.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web

Fixed: The Synology NAS with Plex Server and mismatched version numbers

February 4, '14 Comments [16] Posted in Bugs | Musings
Sponsored By

I am a HUGE fan of Plex. Plex is a server you run combined with both a great HTML5 web app and some awesome native clients. Plex has clients for iOS, Windows Store, Windows Phone, and on and on. Best yet, the Plex Server can run not only on your spare computers, but also NAS (Network Attached Storage) devices like Synology, Netgear, Drobo, and more.

Last year, Plex came to the Synology DiskStation. I have a Synology 1511+ NAS and run everything on it from Minecraft Servers to Plex to using it as a giant 5TB NAS to storing my Time Machine backups and Windows 8 File History. I also run CrashPlan headless on my Synology.

Synology has an ersatz App Store that allows you to easily install all sorts of stuff to your Synology NAS, like phpBB, Plex, Git, and more.

Plex installed on Synology

However, I personally (and others) have found this feed of packages to be either updated not very often, or when it is updated, versions don't line up.

If I can be slightly critical of Plex for a moment, they are fairly aggressive about keeping their client and server protocol versions in line. This means if you aren't keeping your Plex Server reasonably up to date, one day you'll startup your iPad Plex app or Windows Plex app and be told that server version is too old. It's a little jarring.

The issue for me happens when I go to the Synology to update and there's no new update. So the client is saying "you need version x+2" and all I see on the Synology feed is version x.

Plex example on a Microsoft Surface RT with Windows 8

Here's the gotcha, and why I'm writing this up for you. You can use the Manual Install option (as seen in the top picture) then visit https://plex.tv/downloads and manually upload the .SPK file for Plex to your Synology server.

If you don't uninstall Plex first - that's the one that you install from Synology's feed originally - then you can get yourself into some very weird versioning situations where Plex thinks one version is running and the Synology thinks another as seen in the screenshot below.

Plex Version Numbers not lining up

This has been discussed in the forums for almost a year now with no clear answer or solution.

Again, here's what I did:

  • Uninstall Plex from the Synology Package Manager
  • Download Plex from https://plex.tv/downloads
  • Use Manual Install to install the new SPK to Synology

I hope this helps someone. Be sure to check out Plex, it's a joy.


Sponsor: Big Thanks to Aspose for sponsoring the blog this week! Aspose.Total for .NET has all the APIs you need to create, manipulate and convert Microsoft Office documents and a host of other file formats in your applications. Curious? Start a free trial today.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web

Fix: External Mouse freezing on Lenovo Laptops with Synaptics TouchPad

December 17, '13 Comments [15] Posted in Bugs | Tools
Sponsored By

I'm just blogging this to make sure I remember it, but also to help others who might need this fix.

I recently noticed that my external Microsoft Arc Touch Mouse would freeze every few minutes. I'd be moving it, then the mouse would just stop. It was extremely annoying. I recently upgraded to Windows 8.1 so my first reaction was to assume that something broke because "stuff is new."

However, I sat down and thought about the problem and noticed that if I moved the TouchPad on my laptop after the external mouse appeared frozen my external mouse would be responsive again. Something was disabling the mouse as I was moving around. I figured it was the Palm Check feature of the laptop's touchpad, meant to disable mice whilst typing fast. Turned out during a recent driver upgrade it was set to Maximum. I turned it down two notches and my mouse freezing problem was solved.

Hit the Windows button and from the Start Screen type "mouse." You want this one, not the "metro" or fullscreen mouse settings.

image

If you have the Lenovo or Synaptics drivers, select the UltraNav tab...

image

Then Settings...then  PalmCheck. Put it a few notches below Maximum.

image

I hope this helps. I'm starting to realize that most all of my frustrations with touchpads and mice on Windows are related to poor defaults and settings in the 3rd party drivers, and now I check those first when I have issues.


Sponsor: Thanks to Aspose for sponsoring the blog feed this week! Aspose.Total for .NET has all the APIs you need to create, manipulate and convert Microsoft Office documents and a host of other file formats in your applications. Curious? Start a free trial today!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web

CSI: Visual Studio - Unable to translate Unicode character at index X to specified code page

June 8, '13 Comments [17] Posted in Bugs
Sponsored By
A crazy internal error from Visual Studio

A customer emailed me a weird one. I tend to have a sense for when something is up and when an obscure thing will turn into something interesting.

The person says:

...mysteriously most of my projects refuse to build.  "The build stopped unexpectedly because of an internal failure... something about unicode... blah blah"

There are a few messages out there on the web about it -- even a really old hot fix.  What's the best way to proceed with the VS team / MS?  Is there anyone actively interested in glitches like this?

My spidey-sense is tingling. First, when something says "internal failure" it means some fundamental expectation wasn't met. Garbage in perhaps? He says "most of my projects" which implies it's not a specific project. There's also the sense that this is a "suddenly things stopped working" type thing. Presumably it worked before.

I say:

"Have you checked all the source files to make sure one isn't filled with Unicode nulls or something?"

And says no, but sends a call-stack (which is always nice when it's sent FIRST, but still):

Error    1    The build stopped unexpectedly because of an internal failure.
System.Text.EncoderFallbackException: Unable to translate Unicode character \uD97C at index 1321 to specified code page.
at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index)
at System.Text.EncoderFallbackBuffer.InternalFallback(Char ch, Char*& chars)
at System.Text.UTF8Encoding.GetByteCount(Char* chars, Int32 count, EncoderNLS baseEncoder)
at System.Text.UTF8Encoding.GetByteCount(String chars)
at System.IO.BinaryWriter.Write(String value)
at Microsoft.Build.BackEnd.NodePacketTranslator.NodePacketWriteTranslator.TranslateDictionary(Dictionary`2& dictionary, IEqualityComparer`1 comparer)
at Microsoft.Build.Execution.BuildParameters.Microsoft.Build.BackEnd.INodePacketTranslatable.Translate(INodePacketTranslator translator)
at Microsoft.Build.BackEnd.NodePacketTranslator.NodePacketWriteTranslator.Translate[T](T& value, NodePacketValueFactory`1 factory)
at Microsoft.Build.BackEnd.NodeConfiguration.Translate(INodePacketTranslator translator)
at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.NodeContext.SendData(INodePacket packet)
...

OK, so it doesn't like a character. But a character in WHAT? Well, we'd assume a source file, but it's important to remember that there's other pieces of input to a compiler like path names, environment variables, commands passed to the compiler as switches, etc.

It says Index 1321 which seems pretty far into a string before it gets mad. I asked a few people inside and Sara Joiner says:

It looks like the only place in BuildParameters that we call TranslateDictionary is when transferring the state of the environment [variables] across the wire. 

Ah, so this is splitting up name-value pairs that are the environment variables! David Kean says "ask him what his PATH looks like." I ask and I get almost 2000 bytes of PATH! It's a HUGE path, it looks like it may even have been duplicated and appended to itself a few times.

Here's just a bit of the PATH in question. See anything?

\;C:\PROGRA~1\DISKEE~1\DISKEE~1\;C:\Program Files (x86)\Windows Kits\8.0\Windows
Performance Toolkit\;C:\Program Files\Microsoft SQL
Server\110\Tools\Binn\;C:\Program Files\Microsoft\Web Platform
Installer\;C:\Program Files\TortoiseSVN\binVN\???p??;C:\Program
Files\TortoiseSVN\bin;C:\PHP\;C:\progra~1\NVIDIA
Corporation\PhysX\Common;C:\progra~2\Common Files\Microsoft Shared\Windows
Live;C:\progra~1\Common Files\Microsoft Shared\Windows
Live;C:\q\w32;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;
C:\Windows\System32\WindowsPowerShell\v1.0\;C:\progra~2\WIDCOMM\Bluetooth
Software\;C:\progra~2\WIDCOMM\Bluetooth

See those ??? marks? That doesn't feel like question marks to me. I open the result of "SET > env.txt" as a binary file in Visual Studio and it looks like it's 3Fs, which are ? marks.

I think the text file was converted to ANSI

This makes me think that there's unicode goo in the PATH that was converted to ANSI with it was piped. Phrased differently, this text file isn't reality.

However, elsewhere in the Windows UI his PATH variable looks like different.

C:\Program Files\TortoiseSVN\binVN\�侱ᤣp䥠؉;

Sometimes that corruption in the path looks like this and you might assume it's Chinese. No, it's corruption that's getting interpreted as Unicode. Interestingly the error said the naughty character was 0xD97C which is &#0xD97C; � which implies to me that something got stripped out at some point in processing and turned into the Unicode equivalent of 'uh...' Regardless, it's wrong and it needs to be removed.

I ask him if cleaning his PATH worked and the customer just send me a one line response via email...the best kind of response:

========== Build: 12 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Yay! I hope this helps the next person who goes aGoogling for the answer and thought they were alone. Thanks to David Kean, Sara Joiner and Srinivas Nadimpalli for looking at the call stack and guessing at solutions with me!

Any insights, Dear Reader?


Sponsor: Big thanks to RedGate for sponsoring the feed this week! Check out Deployment Manager – app deployment without the stress. Deploy .NET code & SQL Server databases in one simple process from a web-based UI. Works with local, remote and cloud servers. Try it free.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web
Page 1 of 37 in the Bugs category Next Page

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.