Thursday, 27 February 2014

WPF PasswordBox control click crashes Application if Fonts aren’t available

I recently had an issue where a kiosk application I was developing would crash on a Windows Embedded 7 system, if the user clicked on a PasswordBox control. Annoyingly, I couldn’t replicate this in my test environment.

The Application would crash, and frustratingly, not actually hit any of my Error Handlers. However, the Windows Application Event Log shined a little more on the issue, returning the following;

Application: FrontEnd.exe
Framework Version: v4.0.30319
Description: The application requested process termination through System.Environment.FailFast(string message).
Message: Unrecoverable system error.
Stack:
   at System.Environment.FailFast(System.String)
   at MS.Internal.Invariant.FailFast(System.String, System.String)
   at MS.Internal.Invariant.Assert(Boolean)
   at System.Windows.Media.FontFamily.get_FirstFontFamily()
   at System.Windows.Media.FontFamily.get_LineSpacing()………

After doing some digging around, I found that I wasn’t the only person that this had happened to;

http://stackoverflow.com/questions/8821648/why-does-a-passwordbox-control-crash-my-wpf-application

and…

http://social.msdn.microsoft.com/Forums/vstudio/ar-SA/fc2c9a54-8f66-4f1a-82be-cb40ada5fba5/systemwindowsmediafontfamily-crash-net-35-sp1-systemexecutionengineexception?forum=wpf

Where the final post by Brendave suggested installing the following fonts on the machine;

  • Arial (TrueType)
  • Courier New (TrueType)
  • Times New Roman (TrueType)
  • Marlette

I couldn’t actually find Marlette on my system, so didn’t copy this one, and I also assumed that if it was working ok on my system anyway, then chances were this Font being missing wasn’t the issue.

After installing these fonts, magically the issue was solved.

Tuesday, 21 January 2014

Chrome v32.0.1700.76 - Dropdown Scrollbars not functioning – January 2014

I’ve noticed that, since the recent silent Chrome update to v32.0.1700.76, the Dropdown Scrollbars have stopped working. Turns out this is a widespread problem, but downloading the latest Chrome Beta V33 solves this issue.

This can be found here;

http://www.google.co.uk/intl/en/chrome/browser/beta.html

Thursday, 21 November 2013

Cannot browse for Files in SSMS 2008 R2–Cannot access the specified path or file on the server

Recently, while dealing with a client, I can across an issue where I couldn’t restore a database.

Whenever I pressed the “Add” button, I was shown a warning box, similair to;

image

After which, pressing Ok, would leave me with an empty Browse Dialog.

image

It seems as though, if your user does not have the "sysadmin" role, then they will not have sufficient access to the filesystem on the machine in order to open the file browser.

Setting aside the security concerns for one moment....

In order to grant this role;

  1. Log in to SSMS using Windows Authentication
  2. Navigate to Security->Logins
  3. Either double Click, or Right Click and select Properties on the user you're interested in .
  4. In the "Select a page" box, select "Server Roles"
  5. Make sure that the "sysadmin" role is selected
  6. Press Ok to save the change and close the dialog
  7. Exit SSMS
  8. Reopen SSMS and login as the User you wanted, and you should now have sufficient Privileges to browse.