Monday, 23 February 2015

Windows 7 Weather Gadget: Cannot connect to service issue

Please follow this to fix the issue.

  1. Go to %localappdata%\Microsoft\Windows Live\Services\Cache
  2. Open "Config.xml" , Right click on it Select Edit, it will open in Notepad.
  3. Click on File>> Save (without doing any changes)
  4. Restart the Gadget after a Minute and it should start working.

However, it may be a temporary fix.  Many (myself included) report the problem returning. 

(Note: This fix appears to work, even if you're testing in IE10 with ActiveX settings as follows, using this code here http://jsfiddle.net/4aww6o3t/

and you get the Access is denied error from the call to oMSN.GetService("weather")

image

try
{
    // Connect to Weather Service .dll
    var oMSN = new ActiveXObject("wlsrvc.WLServices");
    var oMSN2 = new ActiveXObject("wlsrvc.WLServices");
    this.oMSN = oMSN.GetService("weather"); // Object to send and recieve weather data queries and to poll for service existence
    this.oMSN2 = oMSN2.GetService("weather"); // Object to send a latlong query and recieve a location code corresponding to the latlong
}
catch (objException)
{
    this.isValid = false;
    this.statusMessage = getLocalizedString('ServiceNotAvailable');
    this.oMSN = new Object();
    this.oMSN2 = new Object();
}

Update: 10:48 03/03/2015

Have just managed to write a batch file that fixes this issue ongoing. By adding this batch file to a scheduled task using the Task Scheduler, I've managed to get the gadget to always work now.

Note to use this batch file you'll just have to create a copy of the Settings.ini and call it Settings3Monitors.ini in the folder %userprofile%\AppData\Local\Microsoft\Windows Sidebar

taskkill /IM sidebar.exe /T /F

REM Fix for windows security update

pushd "%localappdata%\microsoft\windows live\services\cache"

IF EXIST ConfigOriginal.xml. (

     echo ConfigOriginal.xml file exists

) ELSE (

     copy Config.xml ConfigOriginal.xml

)

attrib "%localappdata%\microsoft\windows live\services\cache\*.xml" -r

del Config.xml

copy ConfigOriginal.xml Config.xml

echo. >> "Config.xml"

popd

REM Restart sidebar

pushd "%userprofile%\AppData\Local\Microsoft\Windows Sidebar"

xcopy /Y Settings3Monitors.ini Settings.ini

popd

start "" sidebar.exe

2 comments:

  1. The short term solution (open Config.xml and saved it) worked for me. If it stops working again, I'll try the long term solution.
    Thanks a lot. You are a genious!

    ReplyDelete
    Replies
    1. So far so good for me at least. Weather gadget still going strong, with a restart every hour via the scheduled task mentioned above. I was running that restart sidebar task anyway before, due to a memory leak in the london underground gadget that I have installed as well.

      Delete

How to find the last interactive logons in Windows using PowerShell

Use the following powershell script to find the last users to login to a box since a given date, in this case the 21st April 2022 at 12pm un...