Friday, February 26, 2010

Migrating ClickOnce deployment to IIS7 and Fiddler Web Debugger

After migrating ClickOnce deployment to IIS7 I tried to install the application I got following exception:

System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
 - Downloading file_name_.extension did not succeed.

I have checked the log but still I could not figure out what exactly was wrong and my colleague suggested using the Fiddler (thanks Benny!) – great Web Debugging Proxy which logs all HTTP(S) traffic between your computer and the Internet. The Fiddler allows you to inspect all HTTP(S) traffic, set breakpoints, and "fiddle" with incoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, and can be extended using any .NET language.

Fiddler helped me found out that there were some missing MIME types configured on IIS 7. IIS uses a default list of global MIME types to determine which types of content to serve. If a client requests a MIME type that is not defined on the Web server, IIS returns a 404.3 error (according to MSDN). To fix this I had to add those missing MIME types in the IIS7 configuration.

After adding MIME types to the configuration I got again the same exception but this time a ".config" file could not be downloaded and again the Fiddler helped me figure out what was wrong. This time it was Request Filtering - IIS7 has really many types denied in request filtering by default. If your ClickOnce application contains .config file you have to allow this extension in request filtering feature.
After allowing the ".config" extension in request filtering feature in IIS7 the deployment started to work. Problem solved.

No comments: