0

I was trying to build RESTful API, but I am getting an error in web.config file. Error is as below

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

Here is web.config code:

<?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>

Please help me out, if you think this information is not enough for you. Please see complete code at http://www.codeproject.com/Articles/255684/Create-and-Consume-RESTFul-Service-in-NET-Framewor

4

1 回答 1

0

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

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

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

马丁

于 2013-07-28T17:46:29.673 回答