Last post Feb 10, 2011 11:04 AM by XiaoCheng Fan - MSFT
Feb 04, 2011 12:47 PM|barryfz|LINK
I need to get the mime types in an IIS7 environment. They should be in:
As I understand it, in IIS7 if I can get to it I should see both custom additions in my web.config as well as the mime types defined in the IIS manager at the machine level.
I don't understand how to get to this data. I have messed with the configurationmanager but I am not getting anywhere. I can get a section names system.webServer but I don't see any of the actual data as colleciton of properties or as xml.
Feb 10, 2011 11:04 AM|XiaoCheng Fan - MSFT|LINK
As mimemaps defined in system.webServer/staticContent, you need to write getsections as:
ConfigurationSection staticContentSection = config.GetSection("system.webServer/staticContent"); ConfigurationElementCollection staticContentCollection = staticContentSection.GetCollection();
For more details:
I hope this can be helpful for you.