Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to register MIME types and file extensions to IIS?

Status
Not open for further replies.

sachintha81

Programmer
Apr 15, 2010
2
0
0
JP
We have a web service, for which to work a particular file extension (.jdf) needs to be registered under MIME types in IIS. Usually what we do is after installing the service (by executing setup file) we go to the particular entry 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 code sample would be of great help. Thanks in advance.
 
I can't remember exactly how to manage IIS settings by code, but I believe it's done similar to how you'd access LDAP via DirectoryServices. Try google-ing around IIS and DirectoryServices and you may find something specific to your needs.

Sorry if I'm not much of a help. [wink]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top