Viewing entries in
Development

1 Comment

Tip – Test sending emails from your application without an SMTP Server

Frequently the applications that we develop will need to send out an email (e.g. for account registration, order confirmation or newsletter). How does a developer tests that the emails are formatted and mail merged correctly? The options you have are:

  • Local or other SMTP server (not applicable for Windows 7 as there is no local SMTP server option anymore)
  • Local Directory Delivery
  • Smtp4Dev (recommended)

1 Comment

Comment

Configuring IIS 6.0 for Silverlight

By default when you deploy a Silverlight application to an IIS 6.0 server and try to load the page, you will get a JavaScript error:

Error: Unhandled Error in Silverlight Application
Code: 2104   
Category: InitializeError      
Message: Could not download the Silverlight application. Check web server settings

Comment

Comment

Setting up ASP.NET 4.0 with IIS 6.0

You may run into an error with Windows 2003 Server and IIS 6.0 when trying to deploy an ASP.NET 4.0 web application.

<compilation debug=”true” targetFramework=”4.0”>
    <assemblies> 
        :
        :
    </assemblies>
</compilation>

Exception information:
    Exception type: ConfigurationErrorsException
    Exception message: Unrecognized attribute ‘targetFramework’. Note that attribute names are case-sensitive.

At this point there are two options:

  1. Configure IIS 6.0 to run the .NET 4.0 framework (more involved)
  2. Retarget your ASP.NET web application to use the .NET 3.5 Framework (easy)

Comment

2 Comments

Adding custom http header to all WCF requests

I needed to add a customer http header to the outgoing request of a web service call (for authentication purposes). With old web services it was easy to do this, but with WCF it’s a bit tricker. The good thing is that WCF is *very* extensible.

To do this, we need to create a custom WCF behavior and message inspector.

The solution file is available in the resources section of the post.

2 Comments

Comment

401.1 Unauthorized - IIS & WCF using custom host headers and host entry

I ran into a bit of a issue today at a client with Windows Authentication and WCF services (it seems like a very common problem) where I was using a host header in IIS to test a web application I was working on. To do this, I added an entry to the hosts file in %windir%\system32\drivers\etc to map the custom host name (e.g. testapp.com) to 127.0.0.1

Accessing the web application worked fine, but trying to access the WCF services hosted under IIS (also using Windows Authentication) kept prompting the login dialog and then eventually failing with the dreaded 401.1 - Unauthorized

Adrian Foyn pointed me to a registry hack to enable loopbacks by setting the registry key:

Comment