PlatformNotSupportedException when accessing HttpReponse.Headers

I encounter the following exception when accessing
HttpResponse.Headers after having installed .net 3.5 SDK:

[PlatformNotSupportedException: This operation requires IIS integrated
pipeline mode.]
System.Web.HttpResponse.get_Headers() +3300614

My server is windows 2003 (iis6), my dev environment is winxppro
(either iis5 or vswebdevserver).

I've saw description of this exception here

http://msdn2.microsoft.com/en-us/library/system.web.httpresp onse.headers.aspx#ddueExceptionsToggle

but I don't understand why it should apply because I don't use iis 7.

I'm working arround by hacking ContentType property appending required
headers, but I wonder if there is a way to fix this problem?

Thanks,

Gauthier Segay
newsgroup.poster [ Mi, 02 April 2008 18:02 ] [ ID #1933677 ]

Re: PlatformNotSupportedException when accessing HttpReponse.Headers

The feature you're looking for only works with IIS 7, that's why you're
getting the PlatformNotSupportedException. If you try to run this code on
IIS 6 you'll get this exact error because it's not available. The way you're
doing this is correct for the version of IIS you have available.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - Expression

<newsgroup.poster [at] gmail.com> wrote in message
news:938d7785-61af-491e-b8d0-5a18aaaca18b [at] e6g2000prf.googleg roups.com...
>I encounter the following exception when accessing
> HttpResponse.Headers after having installed .net 3.5 SDK:
>
> [PlatformNotSupportedException: This operation requires IIS integrated
> pipeline mode.]
> System.Web.HttpResponse.get_Headers() +3300614
>
> My server is windows 2003 (iis6), my dev environment is winxppro
> (either iis5 or vswebdevserver).
>
> I've saw description of this exception here
>
> http://msdn2.microsoft.com/en-us/library/system.web.httpresp onse.headers.aspx#ddueExceptionsToggle
>
> but I don't understand why it should apply because I don't use iis 7.
>
> I'm working arround by hacking ContentType property appending required
> headers, but I wonder if there is a way to fix this problem?
>
> Thanks,
>
> Gauthier Segay
Mark Fitzpatrick [ Mi, 02 April 2008 18:09 ] [ ID #1933678 ]

Re: PlatformNotSupportedException when accessing HttpReponse.Headers

I got confused because I sure have used headers with asp.net before,
but it seems I was wrong and always relied on this trick.

Thanks for your answer and clarification.

On 2 avr, 18:09, "Mark Fitzpatrick" <markf... [at] fitzme.com> wrote:
> The feature you're looking for only works with IIS 7, that's why you're
> getting the PlatformNotSupportedException. If you try to run this code on
> IIS 6 you'll get this exact error because it's not available. The way you'=
re
> doing this is correct for the version of IIS you have available.
>
> Hope this helps,
> Mark Fitzpatrick
> Microsoft MVP - Expression
>
> <newsgroup.pos... [at] gmail.com> wrote in message
>
> news:938d7785-61af-491e-b8d0-5a18aaaca18b [at] e6g2000prf.googleg roups.com...
>
>
>
> >I encounter the following exception when accessing
> > HttpResponse.Headers after having installed .net 3.5 SDK:
>
> > [PlatformNotSupportedException: This operation requires IIS integrated
> > pipeline mode.]
> > =A0 System.Web.HttpResponse.get_Headers() +3300614
>
> > My server is windows 2003 (iis6), my dev environment is winxppro
> > (either iis5 or vswebdevserver).
>
> > I've saw description of this exception here
>
> >http://msdn2.microsoft.com/en-us/library/system.web.httpres ponse.head...
>
> > but I don't understand why it should apply because I don't use iis 7.
>
> > I'm working arround by hacking ContentType property appending required
> > headers, but I wonder if there is a way to fix this problem?
>
> > Thanks,
>
> > Gauthier Segay- Masquer le texte des messages pr=E9c=E9dents -
>
> - Afficher le texte des messages pr=E9c=E9dents -
newsgroup.poster [ Mi, 02 April 2008 18:19 ] [ ID #1933680 ]
Microsoft » microsoft.public.dotnet.framework.aspnet » PlatformNotSupportedException when accessing HttpReponse.Headers

Vorheriges Thema: RE: Server page to page addressing
Nächstes Thema: Dns.Resolve / GetHostByAddress deprecated in c# 2?