Feed Subscribe
Exception has been thrown by the target of an invocation.


Windows Live Writer crashes on start when My Documents folder is not accessible

by ondrejsv 26. December 2010 12:13

Today I couldn’t start my Windows Live Writer as it had been constantly crashing on start. I had the 2010 version and the error exception on start was the infamous NullReferenceException. I upgraded to the latest Writer 2011 but no lack – this time it kept crashing with Windows Live own exception DirectoryException (obviously the team in the 2011 version did some more checks and create a special exception). But why?

It choked in the WindowsLive.Writer.CoreServices.ApplicationEnvironment method. A little dig in the WindowsLive.Writer.CoreServices.dll in the Reflector shows the culprit:

path = Environment.GetFolderPath(Environment.SpecialFolder.Personal); _myWeblogPostsFolder = _userSettingsRoot.GetString("PostsDirectory", null); if (string.IsNullOrEmpty(_myWeblogPostsFolder)) { if ((_productName == "Windows Live Writer") && string.IsNullOrEmpty(path)) { throw new DirectoryException(MessageId.PersonalDirectoryFail); } _myWeblogPostsFolder = Path.Combine(path, "My Weblog Posts"); }

Indeed, the Environment.GetFolderPath(Environment.SpecialFolder.Personal) gave null result since I don’t have a custom path for saving blog posts set in the Windows Live Writer.

Then I remembered that we have the My Documents folder redirected on the network share which was unavailable and I had turned off the offline files Windows feature (because it slows down the boot time considerably – to 15 minutes and more).

So either connected to the network to have your My Documents folder accessible or make it available offline when using Windows Live Writer.

Tags:

Comments are closed