简体   繁体   中英

WCF: with and without, aspNetCompatibilityEnabled

I have two WCF services in my application that are using for ajax calls.

First one is using HttpContext.Current.Session so I have to set

aspNetCompatibilityEnabled = "true"

in my Web.config.

Second one is used to show progress values so it has to be called during code behind executions but when I have aspNetCompatibilityEnabled = "true" , it wait for other things to complete and then start my service. so I have to set aspNetCompatibilityEnabled = "false"

How can I set aspNetCompatibilityEnabled = "true" for first one AND aspNetCompatibilityEnabled = "false" for second one?

UPDATE-------------

what I want is to have two WCF services. First one: With aspNetCompatibilityEnabled = "true" Second: With aspNetCompatibilityEnabled = "false"

From the doc: ASP.NET compatibility is enabled for the current AppDomain .

You can't have a different setting per endpoint because the setting is for the complete app domain your app is running in. So either all your endpoints or none of your endpoints (either WCF or other handlers) run in ASP.NET compatibility mode. And with that thel have access to features from the HTTP application pipeline or none have access to those features.

If you really need to distinguish between the two, you have to split your endpoints over two applications, each running in its own app domain/ application pool.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM