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

Tuesday 17 February 2015

Default Notepad++ to XML language sytnax highlighting for .config files

On the Notepad++ menu bar, click "Settings" -> "Styler Configurator..."

image
- Under "Language", select "XML"
- Under "User ext", type in "config".  While we're at it, let's also type in (space delimited) "aspx", "ascx", and "master".
- Click "Save & Close"

That's it!  Now when you view config files, ASP.NET pages, user controls, or master pages in Notepad++, you'll get syntax highlighting.

More about this here... http://www.mattblodgett.com/2007/11/notepad-tip-syntax-highlighting-for.html

Monday 16 February 2015

TFS Http 404 not found error

If you get an HTTP 404 not found error when connecting to TFS

clip_image002

Delete all the files in this folder

%userprofile%\AppData\Local\Microsoft\Team Foundation\4.0\Cache

You also may receive an error message in the VS 2013 output window, reading as follows...

We were unable to automatically populate your Visual Studio Online accounts.

The following error was encountered: One or more errors occurred.TF205020: Could not connect to server ‘tfs.russellreynolds.com\DefaultCollection’. This server was used in your last session, but it might be offline or unreachable. Confirm that the server is available on the network. To attempt to connect again, or to a different server, click ‘Connect To Team Foundation Server’ in Team Explorer or the Team menu.

The server returned the following error: HTTP code 404: Not Found

Wednesday 11 February 2015

Resharper running slowly

Just found a neat trick for speeding up the Ctrl+T navigation slowness against my solution with JetBrains Resharper 8.2

1. Clean out your cache folder for the solution...

%userprofile%\AppData\Local\JetBrains\ReSharper\v8.2\SolutionCaches

2. Resinstall Resharper

Monday 2 February 2015

MVC / Jquery unobtrusive validation

http://www.devtrends.co.uk/blog/the-complete-guide-to-validation-in-asp.net-mvc-3-part-1

Also for how do attach a new client side method to unobtrusive validation e.g.

jQuery.validator.unobtrusive.adapters.add(adapterName, [params], fn);

see this article...

http://bradwilson.typepad.com/blog/2010/10/mvc3-unobtrusive-validation.html

 

Note: For any element a in your <form>, you can do this to figure out what validation is attached to the containing <form> for that element...


$.data(a.form, "validator").settings.rules

e.g.

$.data(a.form, "validator").settings.rules.MiddleInitial
Object {maxlength: "1", __dummy__: true}

$.data(a.form, "validator").settings.messages.MiddleInitial
Object {maxlength: "The middle initial must be a single charater"}

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...