Link to home
Start Free TrialLog in
Avatar of sachintha81
sachintha81Flag for United States of America

asked on

How to register MIME types and file extensions to IIS?

We have a web service, for which to work a particular file extension (.jdf) needs to be registered under MIME types for that service in IIS. Usually what we do is after installing the service (by executing setup file) we go to the particular entry which is listed under "Default Web Site" in IIS (We use Windows Vista + IIS 7) and under MIME settings manually add a MIME type.

That is we specify it as follows:
File Extension : .jdf
MIME type : text/xml

Now I'm assigned the task of automating this process. Which means this needs to be done automatically during the installation of the service. The installer is built using C# and Wix, so how can I register this using a C# code?

Please note that I'm just a beginner so any step-by-step instructions and (using C#) code sample would be of great help.

Thanks in advance.

P.S.
I found this one but it is not working on Vista.
http://msdn.microsoft.com/en-us/library/ms525901.aspx
Avatar of Shreedhar Ette
Shreedhar Ette
Flag of India image

Hi,

Refer this article:
http://www.hosting.com/support/dedicated/IIS/newmime/

Hope this helps,
Shree
Avatar of sachintha81

ASKER

I actually need a C# code which does this process. As I've stated in the original question we already do this process manually and need to automate it.
ASKER CERTIFIED SOLUTION
Avatar of sachintha81
sachintha81
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial