I have the following scenario. My C# code will be executing in two processes - one process will be the IIS process running under "local service" account, the other will be running under an account with more privileges. Both processes will run C# code, .NET version will be at least 3.5.
The part under IIS contains a set of classes derived from System.Web.IHttpHandler
and each class implements IHttpHandler.ProcessRequest()
method that accepts System.Web.HttpContext
parameter.
I can't do anything useful from IIS part - I need filesystem access, DCOM server activation, other things "local service" can't do by default. So I'd like to somehow forward those ProcessRequest()
calls to the part running under the user with more privileges. I need to forward the object to another process, wait for the call to complete, then the other process will have changed the object and I want to get those changes on the caller process side - so that it looks like it's just one process.
I thought of WCF but I'm not sure it will manage to deal with marshalling HttpContext
between processes. AFAIK (might be wrong) it's necessary for a type to be marked with System.Runtime.Serialization.DataContractAttribute
([DataContract]
) in order to be marshalled, but HttpContext
is marked with this attribute.
Can I marshall HttpContext
through WCF to another process and back so that changes made by the callee are visible to the caller? What better options are there?