Archive for category Troubleshooting

Crash when trying to open VS2010 Beta 2 Help: MSHelpListener.exe has stopped working

Update: There is a Microsoft Connect bug logged for this here.
Update 2: “R0b0tz” has got the workaround for this on his blog. As always it pays to RTFM :) It’s still definitely a bug though…

One big change in Visual Studio 2010 is Microsoft Help version 3. It’s all based on HTML, and when you install the help locally it does a smart trick and installs its own web server (MSHelpListener.exe), allowing the pages to be accessed via the url http://127.0.0.1:80/help.

The problem was the first time I ran the help after installing VS2010 I was getting the following crash…

MSHelpListener.exe has stopped working dialog

If you check the Windows Application event logs you will see the following error:

The port is already in use please select a different port

For some reason, MSHelpListener is unable to bind to port 80 (even though I believe HTTP.sys does allow multiple applications to bind to the same port).

If you go to the command line and run

netsh http show urlacl

You can see that it has also reserved the following url, although it appears this does not help at all in guaranteeing access to the port…

netsh showing urlacl reservation for MS Help 3

I had a quick look in Resource Monitor and this is what I saw:

Resource Monitor showing Skype listening on port 80

You can see Skype was listening on port 80.

It turns out the solution was as simple as quitting Skype!

After I quit Skype I was able to load up the help…

HelpListener.exe successfully running

Once HelpListener.exe is running it is safe to start Skype up again. I have yet to work out why Skype is using port 80, or what circumstances cause one process to block another’s use of a port, given the fact HTTP.sys is supposed to let multiple process share the same port. If you know please leave a comment.

If you find yourself having problems getting the local help working after installing it using “Find content on disk”, the trick that worked for me is to switch to online help and then back to local help.

Help Library Manager screen in VS2010 Beta 2

MS Help 3 Find Content Online

Overall, MS Help v3 looks very nice and works as we probably wished it always had! What is very cool is you can “Find” content either online, or from your installation media. Best of all it just works – getting content from the web is straight forward, and so is installing it from media. Either way the help files can be kept up-to-date easily using “Check for updates online”. Nice

Tags:

Workaround for VisualStateManager.GoToState not working on Window

I am not sure if this is a bug or what, but I’ve had an annoying problem today whereby it seems you are unable to switch states procedurally using code like this:

VisualStateManager.GoToState(this, "MyState", true);

when your control (the first parameter) is not a UserControl. In my case that control was the top level Window of my WPF application.

The strange thing is the state switching works fine when I use the GoToStateAction.

After pouring over the code in Reflector it strikes me that something I don’t yet understand is happening with CustomVisualStateManager which Blend actually sets to be ExtendedVisualStateManager.

It seems ExtendedVisualStateManager has a method called GoToElementState which allows you to pass in a FrameworkElement, whereas GotToState only allows a Control.

By trial and error I found that the following code works:

ExtendedVisualStateManager.GoToElementState(this.LayoutRoot as FrameworkElement, "MyState", true);

where Layroot root is a Grid and is the first child of my Window, and is where the actual VisualStateGroups are defined.

If anyone has an idea what is going on here, and why the GoToState doesn’t work as expected for a Window, please let me know.

Update: According to a comment from Steve at Microsoft, this issue will be fixed when the Visual State Manager gets integrated into .NET Base Class Libraries (BCL) e.g. when WPF 4.0 is released.

Tags:

Update: Ericsson F3507g Mobile Broadband on Windows 7 with Lenovo Thinkpad

It’s become clear from comments on my previous article, that Lenovo have released a new Windows 7 driver for the Ericsson F3507g Mobile Broadband card.

You would never know from glancing at the downloads page because it doesn’t list versions numbers or publish dates…Screenshot of F3507g driver on Lenovo downloads page

The driver is now listed under Vodafone and AT&T Wireless WAN (HSPA) Driver. Just to make things extra confusing (and harder to find) they removed the actual card model number from the description. The new filename  is 7uw706ww.zip (direct download link), and comes in at 40MB (10 MB smaller than the last driver). It comes as a Setup.exe, including both 32-bit and 64-bit drivers.

After installing the new driver (no need to uninstall the previous one), you will have the following new devices in device manager:

  • F3507g Mobile Broadband Driver (Network Adapters)
  • F3507g Mobile Broadband Device Management (COM3)
  • F3507g Mobile Broadband GPS Port (COM6)
  • F3507g Mobile Broadband Device

The crucial thing about the new driver is the change in version from 4.4.50.6.0 (dated 16/12/2008) to 4.54.7103.1 (dated 26/06/2009). The drivers are also HCL certified by Microsoft. Some devices are dated 29/07/2009 and version 1.0.0.52. Either way, all the drivers are much newer :)


image

This driver is radically different from the previous one. The previous driver installs your broadband card as an old school modem (with COM ports et al). This is what made it particularly tricky to setup.

The new driver actually gets the broadband card to show up as… (drum roll)… a Mobile Broadband Connection!

Ericsson F3507G showing as Mobile Broadband  in Network Connections

The upshot of this is that, after installing these drivers you don’t need any third party software to get online!

I am not sure if this device type was available in Vista, but I have certainly never seen it before. It integrates with Windows differently to a dialup modem. One obvious change is that it shows up in the networks list accessed via the system tray like so:

Available connections

You can set it to automatically connect when there is no other connection available, which is quite handy and works quite well.

There is only one trick you may need for setting the APN. To do this you need to go to the networks list and right click, show properties. Note: This is completely different than if you select properties in the Network Connections windows. You should see the following:

Mobile Broadband connection properties under Windows 7, showing APN setting

Here you can enter the APN and username/password if required by your ISP.

There are only a couple of negatives I have discovered so far:

  • Using Wireless Manager it was possible to force the connection to only use HSDPA etc. I can’t find a way to do this with the new setup
  • There is not as much status information available as when using Wireless Manager. For instance, when I am connected, it ALWAYS seems to display UMTS as the connection type, even though I know I am on HSDPA. This may or may not be a bug.

One very exciting feature that I just stumbled upon when researching this article is the Windows 7 Sensor compatible GPS Location driver that gets installed.

F3507g GPS Location Sensor driver for Windows 7!

This new feature for Windows 7 allows applications to access your GPS data through a standard API, for example Google Chrome can use this to position you on Google maps! I have not got this to work so far but I am hoping that’s because I have no GPS signal indoors.

Overall I am happy with the new drivers – it’s certainly a better way to integrate with Windows, and the connection seems to be much more reliable.

How to get Ericsson F3507g Mobile Broadband card working on Windows 7 & Lenovo Thinkpad T400s

Update: A new driver has been released which uses the Windows 7 Mobile Broadband driver framework. Please see my new article. Note: Information and comments on this article could still be relevant to you so read on…

I recently purchased a Lenovo Thinkpad T400s. I installed Windows 7 on it soon after, having heard that almost all hardware devices worked under Windows 7. For me it was crucial that the Ericsson F3507G internal mobile broadband card worked, and luckily there was a driver for it available on Lenovo’s Windows 7 “Beta” drivers

God knows what a "Drever" is!

First thing to note is that even though it says “32-bit”, inside the zip there are actually 64-bit drivers as well. Phew! Unfortunately it seems that versions and publish dates are not supported by Lenovo’s knowledge base, so all we get is a crazy looking file name – 7uwc46ww.zip.

After you install this driver you will have several new devices available in Device Manager:

  • Ericsson F3507g Mobile Broadband Minicard Network Adapter
  • Ericsson F3507g Mobile Broadband Minicard Modem
  • Ericsson F3507g Mobile Broadband Minicard Device Management (COM3)
  • Ericsson F3507g Mobile Broadband Minicard GPS Port (COM6)
  • Ericsson F3507g Mobile Broadband Minicard PC SC Port
  • Ericsson F3507g Mobile Broadband Minicard Composite Device

I am not a big fan of using OEM software over what comes with Windows, as it’s invariably crap. Lenovos’s network manager tool is called Access Connections and I would later discover my intuition would prove to be well founded. Read the rest of this entry »

Tags: ,

Fix for Windows 7 "random wake from sleep" problem

For the last few months I’ve had Windows 7 RC installed on two home computers, and both of them have exhibited a strange problem: They would randomly wake from sleep .

The computers would often wake up just seconds after being shut down. At other times they would wake up in the middle of the night. To make matters worse one PC, which had recently had its graphics card upgraded, would go into an endless loop of restarting without ever getting to the Windows login screen. I suspected a power problem relating to the new card.

I spent quite some time investigating these wake problems (which I believed were unrelated) but could not diagnose the issue. Eventually I gave up and had to disable sleep on both machines (which pained me greatly!).

Last week I had a second wind and was determined to resolve this problem once and for all. I figured there must be a tool that could tell me what caused the wake up events, and after some research I discovered the Vista/Windows 7 powercfg tool.

To use this tool you simply type powercfg –lastwake at the command prompt

powercfg

In the above screenshot you can see the computer was woken by something on the USB hub (my mouse in this case). But much to my annoyance, when I ran this tool after a phantom wake it reported the type was “Unknown”!

Because I had a suspicion this could be a wake-on-lan (WOL) behaviour I used the WireShark network analysis tool to monitor network traffic for WOL packets. Perhaps a third computer had been infected with malware and was trying to wake other computers to have its wicked way? Unfortunately nothing showed up on the wire.

No further progress was made until I randomly stumbled across a forum posting about a network adaptor setting called “Wake on pattern match“. I checked both my PCs and this setting was enabled. It appears this obscure setting is enabled by default in Windows 7 for Realtek RTL8168B/8111B and RTL8168C(P)/8111C(P) Family Gigabit Ethernet NICs.

What does “Wake on pattern match” actually do?

Most people are familiar with Wake-on-LAN which uses a “magic packet” (hard-coded) to trigger a wake event. Well it seems that feature has been superseded by the more flexible “Wake on pattern match” capability. According to this Microsoft Article on Power Management for Network Devices:

The packet patterns that define the wake-up frames [for "wake on pattern match"] are provided to the NDIS 5.0 miniport driver by the operating system. At runtime, the protocol sets the wake-up policy using OIDs. These are, for example, Enable WakeupSet Packet PatternRemove Packet Pattern. Currently, the Microsoft TCP/IP is the only Microsoft protocol stack that supports network power management. It will register the following packet patterns at miniport initialization:

  • Directed Layer Two packet
  • Address resolution protocol (ARP) broadcast for station IP address (frames with DIX header)
  • NetBIOS over TCP/IP broadcast for station’s assigned computername (frames with DIX header)

I am no networking expert but the last two sound like they could be pretty common activities on your typical home network. If so it’s no wonder my computers were exhibiting such crazy wakeup symptoms. (Either that or I have got a renegade PC on my networking sending out these packets).

The solution? Simply disable the “Wake on pattern match” setting under the network adaptors advanced properties tab, as shown below:

realtek_wake_on_pattern_match

My biggest mistake? I could have short circuited the resolution of this problem by testing my computers without the Ethernet cable plugged in right at the start. The reason I didn’t was I couldn’t understand how a WOL packet could possibly be being sent so I ignored the possibility.

Now I know about “Wake on pattern match”, next time I will be prepared.