M
MikeB
Hi,
I had the following code running fine on my xp box. Then, I got a
vista box and now I get a "PlatformNotSupportedException" when I try
to add the header. I do know that now in IIS7 there are different ways
to do things, but I have the issue of deploying to IIS6 servers.
//get a reference
NameValueCollection headers =
HttpContext.Current.Request.Headers;
//get a type
Type t = headers.GetType();
//get the property
PropertyInfo p = t.GetProperty("IsReadOnly",
BindingFlags.Instance | BindingFlags.IgnoreCase
| BindingFlags.NonPublic |
BindingFlags.FlattenHierarchy);
//unset readonly
p.SetValue(headers, false,null);
//add a header
//This breaks in vista
headers.Add("SID", "1234"));
It blows up on the last line. I am using the built in webserver for vs.
2005, but I do have IIS installed on vista.
This code is just in an http module that gets ran as a request is
coming in. Again, it worked fine on my xp box. Any ideas are
appreciated.
I had the following code running fine on my xp box. Then, I got a
vista box and now I get a "PlatformNotSupportedException" when I try
to add the header. I do know that now in IIS7 there are different ways
to do things, but I have the issue of deploying to IIS6 servers.
//get a reference
NameValueCollection headers =
HttpContext.Current.Request.Headers;
//get a type
Type t = headers.GetType();
//get the property
PropertyInfo p = t.GetProperty("IsReadOnly",
BindingFlags.Instance | BindingFlags.IgnoreCase
| BindingFlags.NonPublic |
BindingFlags.FlattenHierarchy);
//unset readonly
p.SetValue(headers, false,null);
//add a header
//This breaks in vista
headers.Add("SID", "1234"));
It blows up on the last line. I am using the built in webserver for vs.
2005, but I do have IIS installed on vista.
This code is just in an http module that gets ran as a request is
coming in. Again, it worked fine on my xp box. Any ideas are
appreciated.