aspNetCompatibilityEnabled仅用于一项服务(aspNetCompatibilityEnabled for just one service)

编程入门 行业动态 更新时间:2024-10-10 03:24:02
aspNetCompatibilityEnabled仅用于一项服务(aspNetCompatibilityEnabled for just one service)

我有一个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?

更多推荐

本文发布于:2023-08-02 07:37:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1372646.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:aspNetCompatibilityEnabled   service

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!