asp.net IIS WCF休息项目添加相同密钥,如何避免重复?

2026-03-30 12:231阅读0评论SEO基础
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计235个文字,预计阅读时间需要1分钟。

asp.net IIS WCF休息项目添加相同密钥,如何避免重复?

我在使用我的+Asp.net应用程序托管WCF+Rest服务,并启用了asp.net兼容模式。它工作正常,当我从Visual Studio运行应用程序时,但在IIS7中访问End Point时,收到错误说已经添加了所有。

我正在使用我的 Asp.net应用程序托管WCF Rest服务,并且启用了asp.net兼容模式,它工作正常
当我从visual studio运行应用程序但是当我在IIS7中时,我在访问End Point时收到错误说“已经添加了具有相同密钥的项目”.
我的服务代码是.

[ServiceContract] [AspNetCompatibilityRequirements (RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class RestService { [OperationContract] [WebGet(UriTemplate = "Site/{Id}", BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] public Site GetSite(string Id) { return new Site(1); } }

和全球ASCX是

protected void Application_Start () { RouteTable.Routes.Add(new ServiceRoute("Rest", new WebServiceHostFactory(), typeof(RestService))); }

和web.config

<system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/> <standardEndpoints> <webHttpEndpoint> <standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="false"/> </webHttpEndpoint> </standardEndpoints> </system.serviceModel>

注意在VS2010模式下每个工作正常但在托管IIS 7时出错
并访问example.com/rest/site/2
有什么建议吗?

asp.net IIS WCF休息项目添加相同密钥,如何避免重复?

在IIS高级设置下然后启用协议我关闭了https,它工作正常.
标签:项目I

本文共计235个文字,预计阅读时间需要1分钟。

asp.net IIS WCF休息项目添加相同密钥,如何避免重复?

我在使用我的+Asp.net应用程序托管WCF+Rest服务,并启用了asp.net兼容模式。它工作正常,当我从Visual Studio运行应用程序时,但在IIS7中访问End Point时,收到错误说已经添加了所有。

我正在使用我的 Asp.net应用程序托管WCF Rest服务,并且启用了asp.net兼容模式,它工作正常
当我从visual studio运行应用程序但是当我在IIS7中时,我在访问End Point时收到错误说“已经添加了具有相同密钥的项目”.
我的服务代码是.

[ServiceContract] [AspNetCompatibilityRequirements (RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] public class RestService { [OperationContract] [WebGet(UriTemplate = "Site/{Id}", BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] public Site GetSite(string Id) { return new Site(1); } }

和全球ASCX是

protected void Application_Start () { RouteTable.Routes.Add(new ServiceRoute("Rest", new WebServiceHostFactory(), typeof(RestService))); }

和web.config

<system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/> <standardEndpoints> <webHttpEndpoint> <standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="false"/> </webHttpEndpoint> </standardEndpoints> </system.serviceModel>

注意在VS2010模式下每个工作正常但在托管IIS 7时出错
并访问example.com/rest/site/2
有什么建议吗?

asp.net IIS WCF休息项目添加相同密钥,如何避免重复?

在IIS高级设置下然后启用协议我关闭了https,它工作正常.
标签:项目I