It’s an external consultant’s dream…

me upgrade to latest, greatest version

opps, forgot to mention the upgrade will hose everything

not to worry, me fix

have you paid that latest invoice

yes, that decimal is in the correct location

I had to share this quote and unfortunately, I can’t take credit for it. When working with some external consultants it is difficult to figure out, should I laugh or be upset. This sounds like it is straight out of a Dilbert comic strip.

.NET Tidbit

After a little bit of searching I discovered that myapp.exe.config is the equivalent of the web.config file. These XML files are used to store the configuration settings in winforms and web ( applications, respectively.

These settings can be accessed using:
System.Configuration.ConfigurationSettings.AppSettings(“mySetting”) VB.NET
System.Configuration.ConfigurationSettings.AppSettings[“mySetting”]; C#

Aside: I have used the web.config file in many web applications and found it a very handy place to organize application settings.

Chasing my tail with EMAB.NET

I have found the Microsoft Application Blocks for .NET very helpful and reusable. However, today I had fun chasing my tail trying to deploy the Microsoft Exception Management Application Block (EMAB). I kept getting this exception in my exception handler:

System.Security.SecurityException: Requested registry access is not allowed.
[SecurityException: Requested registry access is not allowed.]
Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +440
System.Diagnostics.EventLog.CreateEventSource(String source, String logName, String machineName, Boolean useMutex)
System.Diagnostics.EventLog.CreateEventSource(String source, String logName, String machineName)
System.Diagnostics.EventLog.CreateEventSource(String source, String logName)

This exception made me scratch my head since I am not writing any exceptions to the registry. I kept trying to tweak my Web.Config file which contains all my application settings. I assumed that since the error message contained “DefaultPublisher” that my “CustomPublisher” was not executing. Therefore, I keep playing with its configuration trying to make it run.

I didn’t get far doing this and I decided to check the directory permissions where my exception logging was being serialized. I forgot to setup directory level security for this folder on the remote web server. What frustrates me is this security exception wrongly reported that
a) the “DefaultPublisher” was executing when it wasn’t
b) the security exception was in the registry when it was in the file system

I played around a little and confirmed every security exception generates this same message. Wonderful, this security exception must be hard coded for all security problems.

Photo Gallery

I am trying to auto-magically rotate pictures for my photo galleries. I elected to use the exif ‘orientation’ field. However, it seems my camera doesn’t populate this value. Googling, I found a Pentax 330 that does populate this. It has the same firmware (v1.10) as my camera. However, a couple exif fields differ:

Make: Asahi Optical Co.,Ltd
Model: PENTAX Optio 330
vs mine:
Make: PENTAX Corporation
Model: PENTAX Optio 330GS

Grrr, this exif difference appears to be one of the few differences between these two very similar Pentax models. The Pentax 330 uses exif version 0210 where as my Pentax 330GS uses exif version 0220 but populates less exif fields.

I found separate firm updates on the Pentax website for the 330 and the 330GS. I decided not to try flashing my camera with the 330 Ashanti firmware, since it might not have the desired effort rendering my camera useless.

Any ideas for other approaches to auto rotate JPEGs in a loss-less manner would be appreciated.