Developing WCF with HTTPS

by Christoph Herold 13. January 2009 21:22

I just ran across a really nice article describing how to create a self hosted WCF service using HTTPS bindings. It's a nice step-by-step instruction on how to create your own certificates, adding them to your store, configuring the Windows HTTP runtime, and configuring your WCF service. You can find the article on CodeProject at this url: Really nice article, helped me a lot. Kudos to Chris.

Also, Steve Johnson created a nice little GUI for the httpcfg command line tool, which you can find here: It's a nice addition to the article, so you are not completely bound to the console :-)

Tags: ,


DotNetNuke now with jQuery

by Christoph Herold 7. January 2009 11:06

I have been using jQuery with DotNetNuke for a while now, and was very happy to finally see it integrated into DotNetNuke. What makes me wonder, is that there is no central method for including it in DNN 4.9.1. The library has been placed into the folder ~/Resources/Shared/scripts/jquery, but the one usage I could find does not use the ClientScriptManager to include the script. Instead, it manually creates a Literal script control. This will cause the script to be included multiple times, if different controls use it simultaneously. Perhaps this will be "fixed" in a future release. Perhaps adding a method to the ClientAPI for including it would be a good solution for a global include mechanism.

Tags: , , , ,


Outlook 2007 stationeries and image spacing

by Christoph Herold 14. December 2008 23:50

Today, I had to make a template for a mailing. I decided to create it as a stationery for Outlook, since this was the desired way of sending the mails. Not much to it, one might think. I created the HTML for the template (of course using the dreaded layout tables, since OL2007 went back to the stone age with its rendering engine), and copied it and the required images to the stationery folder. Having done that, the stationery showed in my list and I was able to create a mail using the template.

But what's this?! Were do the gaps in between the images come from?! And why are my shadows not aligned anymore?! Outlook simply went on and pratically destroyed my layout. I basically tried everything that came to my mind, trying to fix the gaps: modified paddings and margins using css, html attributes, added fixed widths and heights, nothing seemed to work. I even removed all the tables and simply placed two images after one another, no white space in between. Still, I got my gaps.

When everything seemed hopeless, I decided to simply send the mail the way it was. Guess what: everything is in perfect shape, when the mail arrives. No gaps, everything is aligned perfectly. I can even simply forward this mail, and it looks great in the editor. So the gaps only show, when you first create the mail using the stationery. Afterwards, everything is as it should be.

<rant>Now that's what I call a consistent user experience! Great job from the folks at Microsoft. I wasted a whole day trying to work around this bug.</rant>

And by the way, using stationery is probably not the best solution, since Outlook completely reformats your code and places all those unneccessary MSO* css styles in your mail's code. So if something goes wrong with your mail, you might consider NOT using Outlook to send it in the first place.

Tags: , , ,


SharePoint DateTimeField control and the order of its properties

by Christoph Herold 19. November 2008 17:37

Today, I was building a nice little page layout for SharePoint and wanted to use SharePoint DateTimeField control. Since the field I wanted to edit was DateOnly, I set the corresponding property, leaving me with this code:

<SharePointWebControls:DateTimeField runat="server" id="dtfArticleStartDate"
    DateOnly="true" FieldName="ArticleStartDate" />

Seems fine to me, but ASP.NET did not like it. Or rather, the control did not like it. I got an ArgumentException with the following StackTrace:

[ArgumentException: FieldName value is not specified.]
Microsoft.SharePoint.WebControls.FieldMetadata.get_Field() +150
Microsoft.SharePoint.WebControls.DateTimeField.CreateChildControls() +310
System.Web.UI.Control.EnsureChildControls() +87
Microsoft.SharePoint.WebControls.DateTimeField.set_DateOnly(Boolean value) +29

FieldName value is not specified?! As you can see in my code above, it is indeed specified. But the stack trace gives us more information: The exception occurs in the compiled ASPX file.

  • ASP.MYNEWSPAGE_ASPX__2072755151.__BuildControldtfArticleStartDate():
    - We are building my DateTimeField control.
  • DateTimeField.set_DateOnly:
    - We are setting the DateOnly property.
  • FieldMetadata.get_Field:
    - Getting the field is where the exception occurs.

Note my ASPX-code again: I first set DateOnly="true" and then FieldName="ArticleStartDate". Oh my god, this can't be true... The solution is very simple: change the order of the attributes/properties:

<SharePointWebControls:DateTimeField runat="server" id="dtfArticleStartDate"
    FieldName="ArticleStartDate" DateOnly="true" />

Against all good practices, the SharePoint team actually created a direct dependency between two properties. At least the stack trace directly tells you where things go wrong, so the solution is obvious. Nonetheless, I thought, this was worth noting. It actually made me laugh, when I encountered it. Another one of those nice little pitfalls when working with SharePoint :-)

Tags: , , ,


New FCKEditorProvider for DotNetNuke

by Christoph Herold 11. August 2008 16:18

A newer (beta) version of the FCKEditorProvider for DotNetNuke has been made available:

It finally integrates the newest version of FCKeditor, giving you much better styling support and various other features. So far, my tests have been quite positive with the new version.

One thing to note is the bothering "Red title" style, that is configured by default. If you wish to remove it, you can edit the fckconfig.js files located in the provider's "FCKeditor" and "Custom" folders. Just comment out the line that add the style to FCKeditor's custom styles, and you'll be rid of it.

Regards to Mauricio Márquez for his great work on the integration!

Tags: , , ,


News concerning TransactionScope and Timeouts

by Christoph Herold 28. March 2008 11:33

We finally got a useful response concerning the TransactionScope Timeout problem. Someone else had a similar issue and started a new thread in the Microsoft forums: The issue has been resolved, but only as of the .NET Framework 3.5. There is a new connection string parameter named "Transaction binding". This is set to "Implicit unbind", which by default causes the described (mis-)behavior. Instead, you must set it to "explicit unbind", so that queries issued after the transaction times out are still considered to be INSIDE the transaction and not in auto-commit mode. You can read the details in the forum post.

Alas, this only solves the problem when using the SqlClient ADO.NET provider. For all other transactive repositories, the issue still exists.

Tags: , ,


Outlook 2007 HTML-Mail Guidance

by Christoph Herold 25. July 2007 11:12

Microsoft changed the rendering engine in Outlook 2007 to Word's HTML-engine, and it really sucks concerning modern design habits (css-positioning, etc.). So you have to look out for some pitfalls. I found a nice guide for designing HTML-Mails for use in Outlook 2007, which can be found at

Also, Microsoft offers tools to validate HTML files for the Word rendering engine. These can be found at

So, good luck with your e-mail marketing ;-)

Tags: ,

Development | Design

Connecting to a SqlExpress User Instance

by Christoph Herold 25. April 2007 16:41

If you've ever built an ASP.NET application using a User Instance database, you may have come across the problem, that you would have liked to access the database using the Management Studio or similar programs, but just couldn't find the database, because it is in the user instance and not in the database server itself.

I'd like to issue my thanks to Mike of the Sql Server Express Weblog for publishing how it's done. I looked for hours trying to get the database attached to the regular server, but all that is not neccessary. You can directly connect to the user instance by using a named pipe. The original explanation can be found here: Below are the required steps in short.

  • Connect to the server normally.
  • Issue a new query:
    SELECT owning_principal_name, instance_pipe_name, heart_beat FROM sys.dm_os_child_instances
  • Locate the user instance you wish to connect to and copy the instance_pipe_name column's value.
  • Open a new server connection and use the copied value as the server name.

And presto, you can access everything as you would in the regular server.

Note: The pipe name is generated, when the user instance is first created. After that, it will always remain the same, so you can store it for later use. Access is only possible, when the user instance is active (see the heart_beat column). If it is not, you must first launch the application that uses it (i.e. the web site).

Tags: ,

Development | Administration

Create your own .prf file

by Christoph Herold 31. January 2007 15:46

When working with several POP3 accounts, it can be a real pain to always have to enter every single account when you reinstall outlook or have to switch profiles or simply have multiple computers. Other mail clients have an option to export account settings, Outlook doesn't. Bummer...

I ran into the Office Resource Kit, which at least helped a bit by enabling me to create a custom .prf-file. The accounts specified in the file can be used to create a new Outlook profile. A set of instructions on how to do this can be found at When you've created your .prf file, you can set up your accounts on any machine by simply starting it. Hurray for automation :-)



Outlook in a different language

by Christoph Herold 29. January 2007 15:54

When connecting to an exchange account for the first time, it sets up all default folders. This is done using the language of the connecting client, which may result in an unexpected layout. This happened to me, leaving me with english instead of german folders.

This would not have been such a problem, but I wanted to import my structure from a previous account. No problem importing things, but they went into new folders with the german names. Now I had two contact folders, two mailboxes, two calenders, everything was there twice, and the empty ones were the defaults...

At first, I was told, the account would have to be reset completely, wiping out all data already imported. But, actually there is a much simpler way of changing the folder names to the desired language. Simple start the Outlook of your desired langauge from the command line specifying the following parameter:

outlook.exe /resetfoldernames

Presto, everything is in your language. Now importing is a lot more fun because you can actually use the imported data.

Tags: ,


Month List

Impressum (for the Germans)

Christoph Herold

Dieses Weblog wird bereitgestellt und verwaltet durch

Christoph Herold
Ignaz-Semmelweis-Str. 37
41540 Dormagen

Sie erreichen mich unter