使用控制台应用程序托管公开 asp.net ProfileService、ProfileService 和 RoleService 的 WCF 端点
我有一个 MVC Web 应用程序,用作基于控制台的应用程序的接口,该应用程序使用 net.pipe 协议公开一堆 ServiceHost/s。
我想使用 asp.net 会员资格/角色/个人资料提供程序来管理我的用户及其角色和个人资料信息(在控制台应用程序内)。我已经在很多应用程序中这样做了,但通常我直接从 Web 应用程序本身引用这些提供程序。
This service requires ASP.NET compatibility and must be hosted in IIS.
Either host the service in IIS with ASP.NET compatibility turned on in
web.config or set the
AspNetCompatibilityRequirementsAttribute.AspNetCompatibilityRequirementsMode
property to a value other than Required.
现在看来,我无法将该属性设置为“必需”以外的任何属性。
我尝试了另一条路线,该路线使用定义的包装类/接口 此处用于我的身份验证服务,我设法在没有太多麻烦的情况下将其连接到我的 MVC 应用程序中,但这不包括我的授权(使用角色)或配置文件需求。
有没有人对此有解决方案,我不能是唯一尝试这样做的人? 我不是
I've got an MVC web application that is used as an interface to a Console based app that exposes a bunch of ServiceHost/s using the net.pipe protocol.
I would like to use the asp.net membership/role/profile provider to manage my users and their roles and profile information (Inside the Console Application). I've done this in quite a few apps, but normally I reference these providers directly from the web application itself.
This is a good walk-through on doing pretty much what I would like, except I don't want to host the WCF service endpoints in IIS, but inside my console app - which will eventually become a windows service. When I try and host the ServiceHost through my console application I get the following error:
This service requires ASP.NET compatibility and must be hosted in IIS.
Either host the service in IIS with ASP.NET compatibility turned on in
web.config or set the
AspNetCompatibilityRequirementsAttribute.AspNetCompatibilityRequirementsMode
property to a value other than Required.
Now it seems that I won't be able to set that property to anything other than Required.
I've tried another route which is using the wrapper class/interface defined here for my authentication service, which I managed to get wired into in my MVC app without too much trouble, but this doesn't cover my Authorisation (using roles) or profile needs.
Has anyone got a solution to this, I can't be the only one trying to do this? I'm not
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论