Julius's profileJulius Ganns . netzkernPhotosBlogNetwork Tools Help

Blog


    January 25

    Does .NET 3.5 break compatibility?

    At netzkern we use WCF (see my earlier posts) in a couple of SOA projects. We had to create a custom message formatter for the use with an external partner that uses a service interface for wrapping several XML messages of various types (different root nodes and purposes). Because of that I created an IOperationBehavior that attaches my custom formatter if the attribute [ProjectFormatter] is present at the service contract. This formatter knows anything about the messages and is able to 'understand' the other party, because it uses the 'old' XmlSerializer (and not the DataContractSerializer) with additional type information about the contracts.
     
    In .NET 3.0, that runs on our production servers, the following code fragment from my IOperationBehavior runs without any problems:
     
    public void ApplyClientBehavior(OperationDescription operationDescription, ClientOperation clientOperation)
    {
       clientOperation.Formatter = formatter;
    }
     
    But since we installed .NET 3.5 and VS2008 on our development machines, our library started to throw an InvalidCastException error. It claimed that the framework wasn't able to cast our internal message contract to the appropriate Message object in WCF. I debugged my code and noticed that my custom formatter wasn't called anymore. Luckily, I also came across a property that looked suspicious: SerializeRequest. I couldn't remember have seen it before and as it was set to 'false', I decided to be brave and switch the value to 'true':
     
    public void ApplyClientBehavior(OperationDescription operationDescription, ClientOperation clientOperation)
    {
       clientOperation.SerializeRequest = true;
       clientOperation.Formatter = formatter;
    }
     
    Now everything works fine again and I'm a little pissed at Microsoft, but I think, it will go away in a couple of days. I haven't found any word about this 'problem' in the web now, but I'm sure, I will. Breaking compatibility is - by the way - not very professional.
     
    Update
    Obviously Microsoft always had that property, but ignored it. The framework documentation shows it in v3.0 (http://msdn2.microsoft.com/en-us/library/system.servicemodel.dispatcher.clientoperation_members(VS.85).aspx) as well as in v3.5 (http://msdn2.microsoft.com/en-us/library/system.servicemodel.dispatcher.clientoperation_members.aspx). So I wonder why my code worked in the first place...
     
    Update
    As one can see from the following link (http://msdn2.microsoft.com/en-us/library/system.servicemodel.dispatcher.clientoperation.serializerequest(VS.85).aspx), in .NET 3.0 the default value for the property is 'true' so there was no need to explicitly set it. The documentation in .NET 3.5 hasn't changed (http://msdn2.microsoft.com/en-us/library/system.servicemodel.dispatcher.clientoperation.serializerequest.aspx), but obviously the property isn't 'true' by default anymore.
     
    January 18

    Windows Server 32bit and Web Applications

    Did you ever wonder why a lot of companies buy a lot of large servers with 8 GB and then waste their horse power by not configuring them properly?
    Every experienced software architect in the Microsoft world knows, that a 32bit Windows (even a server) can allocate a maximum of 2 GB per user-space process and additionally 2 GB of kernel-space memory. So why buying a server with 8 GB of RAM and having it wasted all that memory? The trick is of course a way to use more than one process to do the work the server was bought for. In an ASP.NET web application that means using multiple w3wp.exe worker processes, also known as a Web Garden. But how do you configure your application pool to make maximum use of your server resources? Well, Jesper has written an execellent article about that specific topic. You should really take a look!
    And by the way: Don't forget about the Session State or you might loose a lot of customers.

    Sitecore Competence Center Germany - Vol. 2

    We're at netzkern are really excited to announce three more Sitecore Level 1 and Level 2 developers in our team. Phil and Heiko have completed SCD1 and SCD2, while Sijo and Markus additionally completed their SCD2 exam very successfully. They now extend our Sitecore Developer Team to 12 certified Level One and 9 Level Two developers as well as 3 upcoming trainers (Markus, Boris, and me) which are going to be certified over the next months.
    Especially I want to thank Lars for doing this great training here in Germany. It was a pleasure to have you here and I'm looking forward to our next meeting as soon as possible!
    Congratulations by the way to my buddy Phil in Austrailia, who has successfully passed the SCD1 and SCD2 trainer exam as well!

    Sitecore Installer Error on Windows Vista

    Hi everyone,
    by installing Sitecore on Windows Vista with UAC enabled, you may get an error regarding th VBScript runtime that is used by the installer. To solve the problem, you need to DELETE the Registry Key "HKCU\SOFTWARE\Classes\CLSID\{ B54F3741-5B07-11CF-A4B0-00AA004A55E8}", which is kind of a wrong registration of the VBScript runtime within the local user registry part. Follow the following link for more information: