我有一个asp.net网站。 我只想为其中一个wcf服务使用asp.net兼容模式。
但是,当我这样做时,我最终收到所有服务的错误消息,因为它试图将它用于每一个服务。
如何有选择地为wcf使用aspNetCompatibilityEnabled。
我这样做是因为性能问题。
I have an asp.net web site. I only want to use asp.net compatibility mode for one of the wcf services.
However when I do this I end up getting an error message for all of the services because it tries to use it for every one of them.
How can I selectively use aspNetCompatibilityEnabled for wcf.
I am doing this because of performance issues.
最满意答案
不幸的是,那是不可能的。 ServiceHostingEnvironment.AspNetCompatibilityEnabled是一个静态成员,因此它始终适用于一个AppDomain中的所有服务。
如果你绝对不希望为某些服务启用AspNetCompatibility,则必须将它们托管在不同的(IIS)应用程序中。 但是仍然可以在同一个网站内! 这适用于您的场景吗?
Unfortunately, that's not possible. ServiceHostingEnvironment.AspNetCompatibilityEnabled is a static member, hence it always applies to all services within one AppDomain.
If you definitely don't want AspNetCompatibility enabled for some services they have to be hosted in a different (IIS) app. Could still be within the same site, though! Would that work for your scenario?
更多推荐
发布评论