Two Solutions: Framework 2.0 deployment woes

I recently deployed the 2.0 Framework to my server, and since have been fighting with problems it’s caused. For instance, when I switched one app to use it, it broke all the other v1.1 web apps I was running (including this blog). Fortunately for me, someone else has been having the same problem and found a solution: move the 2.0 apps into their own application pool. Hooray I don’t have to uninstall (which I was close to doing).

Hey Microsoft, how about mentioning this anywhere? …say during the install, on the IIS site’s tab, or in the error?

I have another related woe, though: If I set a 1.1 app to run under the 2.0 Framework (which should work, and imparts better performance and security), I get the Yellow Screen of Death:

Apparently “global” now a reserved keyword under 2.0 (despite its 1.1 compatibility). Fortunately, I found my own easy fix: just rename the class. So line 11 in my global.asax.vb is now Public Class Global2. Of course I made the same change in its global.asax too: <%@ Application src="Global.asax.vb" Inherits="Global2" %>

Happy to find a solution, and I hope mine helps someone.

Braindump: CDO/MAPI AppointmentItems and Exchange Public Folders

So there’s a bug/limitation/pile-o-crap in CDO (the programmatic interface to use MAPI (the programmatic interface to get at & use Outlook or Exchange stuff)).  A key bit from the MSDN CDO reference:

Calendar folders are not supported in the public folders store provided with Microsoft® Exchange, and AppointmentItem objects are stored as Message objects. An attempt to read IsRecurring in this case returns CdoE_NO_SUPPORT.

This has majorly stunk for me, since I’m doing a project which needs to dump out some Exchange Public Calendars’ AppointmentItems, and to use their StartDate and EndDate properties.  Common refrains to this song and dance:

  • Public member ‘StartDate’ on type ‘Message’ not found. and Public member ‘EndDate’ on type ‘Message’ not found.
  • Ok, I’ll follow the guru’s advice, and explicitly force it to an AppointmentItem: ctype(oMsg, MAPI.AppointmentItem)… Nope, I still hear: Specified cast is not valid.
  • But wait, what’s the oMsg.Type?? IPM.Appointment is my answer. Well… (dead end).

Fortunately there’s this: MAPI Property Tags.  I can get at those two properties via CdoPR_START_DATE and CdoPR_End_DATE.


DIM dtStartDate as Date = oMsg.Fields(MAPI.CdoPropTags.CdoPR_START_DATE).Value
DIM dtEndDate as Date = oMsg.Fields(MAPI.CdoPropTags.CdoPR_End_DATE).Value

Not really properties, but something to work with at least. 

I hit the same problem with getting the users who originally posted and last modified an item, except worse — they seem to be documented nowhere.  I reverse-engineered the fields collection (dumped the data, looked for what I wanted, found the matching ID, converted to a hexadecimal property tag), and found them:

CONST CDoPR_RE_PostedBy = &H3FF8001F
CONST CDoPR_RE_ModifiedBy = &H3FFA001F
DIM strPostedBy as String = oMsg.Fields(CDoPR_RE_PostedBy).Value
DIM strModifiedBy as String = oMsg.Fields(CDoPR_RE_ModifiedBy).Value

I don’t see these tags in the CDO Property Tag list, and google searches for them come back empty.  (That said, consider my discovery subject to change with future versions.)

Too bad there also seems to be no way to use these property tags with a MessageFilter, or to get RecurrencePattern.

Unfortunately, this is part of a bigger problem.  I’m not sure, but I suspect CDO was simply never finished.  Get this: If you want to open a user-created folder, there’s no way to do so directly by name.  The normal method, getFolder(), only accepts a 76-digit FolderID!  There is a solution, but ain’t pretty.

Here’s another bonus from that same link:

If your application is running as a Microsoft® Windows NT® service, you cannot access the Microsoft Exchange Public Folders through the normal hierarchy because of a notification conflict. You must use the InfoStore objects Fields property to obtain the Microsoft Exchange property PR_IPM_PUBLIC_FOLDERS_ENTRYID, property tag &H66310102. This represents the top-level public folder and allows you to access all other public folders through its Folders property.

…And yes, that seems to apply to applications.

Another gem (this seems so ludicrous that I want to doubt it): CDO MAPI in needs to run with impersonation, even if the authenticated user has a matching Exchange account.  It did fix my problem, though, so there’s some more anecdotal evidence.  (Perhaps it’s actually the old Windows domain double-hop bug?)

In general, I’ve noticed CDO seems to require a whole lot of Hex flags to do simples operation like open a message object.  …Well, a whole lot for what should is supposed to be object-oriented code.  I’ve been wrapping up most of these basic operations with a class, but the vast amount of CDO hacks contained are too ugly to be seen here anytime soon. 

SO, Lemsons and the rest of the Exchange Team, have you touched CDO in the last 5 years???  It sure seems to be a stunted and abandoned technology.

good resource:
CDO Live (almost as outdated as CDO itself, though)

10 More Songs

Been a long time since I did my song roll.  So here are the first 10 random picks:

King’s X – Far, Far Away
U2 – Who’s Gonna Ride Your Wild Horses
Newsboys – Shine
The Commodores – Old-fashion Love
Us3 – Knowledge of Self
Porcupine Tree – Phase III
Stuart Hamm – Snoopy’s Theme Song – Peanuts
Sting – Why Should I Cry for You?
Relient K – Chap Stick, Chapped Lips, and Things Like Chemistry
Ohio Players – Only A Child Can Love

Good mixture, I think.

How about a Conversion mode?

The Windows calculator has Standard and Scientific modes… 

Suddenly conspicuous today in its absence was a Conversion mode.  (Heck, I’ve got a little app on my phone which does this.)  Cmon Vista, it just makes sense! 

Especially while we dumb Americans keep resisting metric.  Liquid volume is where it’s hairiest, figuring out:

  • 3 teaspoons to 1 tablespoon
  • 2 tablespoons to 1 fl. oz
  • 4 fl. oz to 1 gill
  • 2 gills to 1 cup
  • 2 cups to 1 pt
  • 2 pts to 1 qt
  • 4 qts to 1 gal

…We should really just drop most of those units.  (What’s the point of ×2 units, anyway??)  It should be much simpler, like:

  • 16 tablespoons to 1 cup
  • 16 cups to 1 gal

If elected, I promise to simplify liquid volumes immediately.

This is Broken

That’s not only the name of a great website on the subject, but also my reaction to this bank website‘s web browser choices:

I let em know how silly this is:

Your choices of web browsers are VERY outdated, by about 10 years!

The main CURRENT web browsers are:
* Internet Explorer
* Mozilla Firefox
* Opera
* Apple Safari
* Konqueror

Take a look at for current browser stats sometime.

Just a heads-up from a web developer. Hope it helps you get it together.

They also offer Unix as a choice of Computer Type, but not Linux.  Even worse: it’s a screen for requesting technical support.  (I sure hope their techs know Mosaic well!!)

Along those lines, I just noticed that this month is the 4th anniversary of IE6.  Happy Birthday, IE!

IE is to blame for Konqueror’s woes

Jon Watson, Linux-fan and almost my neighbor in Kentucky, writes an interesting complaint about the state of web browsing on Linux.

What grabbed my eye was that he blames it on Microsoft:

“Microsoft introduced a whole bunch of ‘IE only’ html tags a couple of years ago. I say predictable because Microsoft is absolutely famous for not following set standards. Take a look at their proposal for their XML ’standard’ or their javascript document model or their…hell…anything you can think of. Open standards are not a friend to Microsoft – they want you locked in to their technology with no way out.”

“…the point of this is to state that these non-standard IE only tags became the norm because of the popularity of IE. Now that arrogance has been extended even further and Google has bought into it. A non-standard Java(-script) call is at the heart of GMail. Now other browsers have to make the choice between being standards compliant, or being MS compliant. A hard decision. To pick the former is responsible, but to pick the latter will deter end users from using the browser.”

About the specific XML/XSL and DOM examples, those simply weren’t yet standardized when they were implemented in IE. The W3C is notorious for being slow to adopt new standards. So rather than “follow the standard”, Microsoft tries to “set the standard”. In practice, this means Microsoft often implements their new ideas at the same time they propose them as standards. As a developer, I think that’s how technological progress is made. Formal committees suck at innovation.

Among IE‘s particular contributions are the XMLHTTPRequest object (which GMail uses), wysiwyg editing in the browser, and IFRAMEs. All 3 features are now either officially standardized or just de facto standards supported by most browsers. This mass adoption isn’t “lock in”, it’s open, and it’s good for both developers and users.

(As an aside, I have no idea how choosing “MS Compliance” could “deter end users from using a browser”. …That makes no sense to me. If a website doesn’t work in a certain web browser, isn’t that the biggest deterrent from using that web browser? Isn’t that in fact the very problem Jon and other Linux folks have with Konqueror??)

What matters to me as a web developer is that I have the best tools available for the job. Otherwise, we’d still be coding “lowest common denominator” — meaning circa 1999. Remember Netscape 4? I do, with chills.

There are also many great IE technologies which have not become standards, nor made it to other browsers: CSS Visual Filters, CSS Expressions, and DHTML Behaviors. As a developer, I wish they would!

By the way, it’s not just Microsoft who takes the “build it and they will come” approach. For instance, Apple’s Safari (Konqueror’s sister browser, which sprung from the same codebase) has been pushing the envelope lately with its (currently non-standard) canvas extensions. Developers and other browsers are taking note, simply because it’s a Good idea. So this may too become standard some day.

No, I don’t credit IE for all the web browser tech progress in the last 5 years. If anything, Mozilla/Gecko/Firefox has appropriated Microsoft’s “embrace and extend” strategy, and done it better. Firefox has embraced both standards and also IE‘s best ideas, and extended with their own extensions (google on CSS “-moz-“ sometime). Following that strategy has made Firefox top dog in the developer world right now They’re the ones setting the standard, and IE7 is now the one playing catch up.

If some browsers choose not to catch up, it seems to me like that’s their own fault.