A
Alex Duggleby
Hi everybody,
I'm trying to add some mime types to the local IIS server using some c#
code.
The code I'm using is:
---snip---
DirectoryEntry _mimeMap =
new DirectoryEntry("IIS://localhost/MimeMap");
System.DirectoryServices.PropertyValueCollection _pcv =
_mimeMap.Properties["MimeMap"];
IISOle.MimeMapClass _mc =
new IISOle.MimeMapClass();
_mc.Extension = ".test";
_mc.MimeType = "application/octet-stream";
---/snip---
My Visual Studio Project has references to IISOle and ActiveDs. When
using Intellisense the object is there, I can browse the object browser,
everything shows up. I can see the MimeMap and MimeMapClass.
When I compile I keep getting:
[...]\IISController.cs(34,4): error CS0246: The type or namespace name
'IISOle' could not be found (are you missing a using directive or an
assembly reference?)
I really have no idea how IntelliSense can find the IISOle Namespace and
the Classes, but the compiler can't. Am I doing something obviously wrong?
I've seen the article:
http://msdn.microsoft.com/library/d...p_security_using_system_directoryservices.asp
but I figured that if IntelliSense can find it, then it should be alright.
Is there any other way to add Mime Types to the IIS Metabase?
Thanks in advance,
Alex Duggleby
I'm trying to add some mime types to the local IIS server using some c#
code.
The code I'm using is:
---snip---
DirectoryEntry _mimeMap =
new DirectoryEntry("IIS://localhost/MimeMap");
System.DirectoryServices.PropertyValueCollection _pcv =
_mimeMap.Properties["MimeMap"];
IISOle.MimeMapClass _mc =
new IISOle.MimeMapClass();
_mc.Extension = ".test";
_mc.MimeType = "application/octet-stream";
---/snip---
My Visual Studio Project has references to IISOle and ActiveDs. When
using Intellisense the object is there, I can browse the object browser,
everything shows up. I can see the MimeMap and MimeMapClass.
When I compile I keep getting:
[...]\IISController.cs(34,4): error CS0246: The type or namespace name
'IISOle' could not be found (are you missing a using directive or an
assembly reference?)
I really have no idea how IntelliSense can find the IISOle Namespace and
the Classes, but the compiler can't. Am I doing something obviously wrong?
I've seen the article:
http://msdn.microsoft.com/library/d...p_security_using_system_directoryservices.asp
but I figured that if IntelliSense can find it, then it should be alright.
Is there any other way to add Mime Types to the IIS Metabase?
Thanks in advance,
Alex Duggleby