Blog posts

  • No Xaml-editor in Visual Studio 2008 problem

    May 07, 2010 | Tags: WPF, XAML, C#, Troubleshooting
    I recently started working on a WPF project in Visual Studio 2008, but didn't get the design mode for the Xaml files to work properly. Trying to turn on the design mode I was faced with the following message:

    There is no editor available for ".xaml". Make sure the application for file type(.xaml) is installed.

    Tried reinstalling service packs and all, but no luch. Until I ran into this thread. The answer given there worked for me too. And it's to close down Visual Studio and then run the following command:

    devenv /resetskippkgs

    Voilá, there was the designer in working order! :)

  • Using relative path in WPF/Xaml

    May 05, 2010 | Tags: WPF, XAML, C#, Snippet
    Creating a new Uri for a relative file path (like "myfolder\myfile.txt") in WPF will result in an UriFormatException being thrown. This is because the parser has no idea what type of path it is. Uri's is far more than "c:\myfile.txt" and you can read all about it over at Microsoft. But to keep it simple, this is what a relative Uri should be written like:

    Uri myRelativeUri = new Uri("pack://siteoforigin:,,,/myfolder/myfile.txt");

  • C# Image Library version 1.2.1 released

    April 29, 2010 | Tags: Image Library, C#
    New minor maintenance release with cleaned up code (much thanks to ReSharper :))

    C# Image Library 1.2.1 - source code
    C# Image Library 1.2.1 - DLL binary

  • Get friendly Url in EPiServer

    April 22, 2010 | Tags: EPiServer, Troubleshooting
    Sometimes you might run into a problem where EPiServer doesn't convert page.LinkURL to a friendly Url. Instead you get an Url to your template with Querystring parameters such as PageId and Language. However there's a way to ensure that you get the friendly Urls instead:
    EPiServer.UrlBuilder url = new EPiServer.UrlBuilder(page.LinkURL);
    EPiServer.Global.UrlRewriteProvider.ConvertToExternal(url, page.PageLink, System.Text.UTF8Encoding.UTF8);
    You then use url.ToString() to get a proper Url.

  • EPiServer: Page cannot be found 404-error

    April 13, 2010 | Tags: EPiServer, ASP.NET, Troubleshooting
    An EPiServer site worked well on the local development machine but just returned a "404 - The page cannot be found" when placed on the test server. However the administration interface worked without any problem, but it was impossible to view the actuall pages on the site.

    In the end it turned out to be the wildcard mapping in the IIS that was the problem. It was set to validate the existence of the physical files before processing them, thus rendering the friendly url rewriter useless.

    Here's the blog post that helped us solve it: