none
Hosting REST template on IIS7 - ASP.net compatibility issues.

    Question

  • Following every post here that had the same issue, I am still unable to resolve the:

    "ASP.NET routing integration feature requires ASP.NET compatibility. Please see 'http://msdn.microsoft.com/en-us/library/ms731336.aspx' on how to do this."

    error.

    Following the instructions on the link doesn't change anything either. I have no clue what to do, as my web.config looks like any other example/fix out there. Here it is for reference:

    <?xml version="1.0"?>
    <configuration>
    
      <system.web>
        <compilation debug="true" targetFramework="4.0" />
      </system.web>
      
      <appSettings>
        <add key="ServiceVersion" value="0.1.0a" />
      </appSettings>
    
      <system.webServer>
        <modules runAllManagedModulesForAllRequests="true">
          <add name="UrlRoutingModule"
            type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, 
                  Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        </modules>
        <handlers>
          <remove name="svc-Integrated-4.0" />
          <add name="svc-Integrated-4.0" path="*" verb="*" type="System.ServiceModel.Activation.ServiceHttpHandlerFactory, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode,runtimeVersionv4.0" />
        </handlers>
      </system.webServer>
    
      <system.serviceModel>
        <standardEndpoints>
          <webHttpEndpoint>
            <!-- 
                Configure the WCF REST service base address via the global.asax.cs file and the default endpoint 
                via the attributes on the <standardEndpoint> element below
            -->
            <standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="false" defaultOutgoingResponseFormat="Json"/>
          </webHttpEndpoint>
        </standardEndpoints>
    
        <behaviors>
          <endpointBehaviors>
            <behavior name="WebHttpBehaviour">
              <webHttp automaticFormatSelectionEnabled="true" defaultBodyStyle="Wrapped" defaultOutgoingResponseFormat="Json" helpEnabled="true" />
            </behavior>
          </endpointBehaviors>
        </behaviors>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
      </system.serviceModel>
    
    </configuration>
    Here is the top of my service class

    [ServiceContract]
        [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
        [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, IncludeExceptionDetailInFaults = true)]
        // NOTE: If the service is renamed, remember to update the global.asax.cs file
        public partial class Service

    I am using the REST template 40 (CS) project template so I don't have a .svc file.

    I have enabled 32 bit applications in my app pool for Oracle (don't know if thats important, but there you go). I have also made sure my app pool is set to .NET 4 and my routing mode is integrated. IIS and ASP.net are installed using the msdn guides. I am using Web Deploy to publish the service and the server is running 2008 R2.

    If you need anymore information to help me diagnose this, i will edit this.

    Monday, October 01, 2012 4:06 PM

Answers

  • Resolved: Was publishing from 2012, it was a 2010 project, so I must be missing something about the new environment. It worked fine when I published it from 2010.
    • Marked as answer by autechr3 Tuesday, October 02, 2012 3:37 PM
    Tuesday, October 02, 2012 3:37 PM