【问题标题】:Restful API in ASP.NET-ErrorASP.NET 中的 Restful API 错误
【发布时间】:2013-07-28 09:57:54
【问题描述】:

我试图构建 RESTful API,但在 web.config 文件中出现错误。 错误如下

在应用程序级别之外使用注册为 allowDefinition='MachineToApplication' 的部分是错误的。此错误可能是由于虚拟目录未在 IIS 中配置为应用程序所致。

这里是 web.config 代码:

<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true">
    </serviceHostingEnvironment>
    <standardEndpoints>
      <webHttpEndpoint>
        <standardEndpoint name="" helpEnabled="true"
    automaticFormatSelectionEnabled="true"></standardEndpoint>
      </webHttpEndpoint>
    </standardEndpoints>
  </system.serviceModel>

 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>

如果您认为这些信息对您来说还不够,请帮帮我。请在http://www.codeproject.com/Articles/255684/Create-and-Consume-RESTFul-Service-in-NET-Framewor查看完整代码

【问题讨论】:

    标签: c# asp.net rest wcf-rest


    【解决方案1】:

    我不确定你是否看过这个,有很多选择:

    https://stackoverflow.com/questions/2355947/error-allowdefinition-machinetoapplication-beyond-application-level

    我首先尝试的是构建菜单中的“清洁应用程序”

    马丁

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-22
      • 1970-01-01
      • 2021-12-12
      • 1970-01-01
      • 2013-03-14
      • 2013-04-18
      相关资源
      最近更新 更多