PlatformNotSupportedException when accessing HttpReponse.Headers

  • Thread starter newsgroup.poster
  • Start date
N

newsgroup.poster

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.httpresponse.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
 
M

Mark Fitzpatrick

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
 
N

newsgroup.poster

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.

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




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

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?

Gauthier Segay- Masquer le texte des messages précédents -

- Afficher le texte des messages précédents -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top