title: ASP.net openID project template and IIS 7.5
body: <p>I'm using the <a href="http://www.dotnetopenauth.net/" rel="nofollow">openID-InfoCard RP template</a> to create a project which uses openID the project works fine on my PC but when I copy the website to our IIS server and try to browse it I'm getting this error :</p>
  
  <p>HTTP Error 500.22 - Internal Server Error
  An ASP.NET setting has been detected that does not apply in Integrated managed pipeline mode.</p>
  
  <p>the application pool is set to .net 4.0
  and this the web.config file :</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!-- 
      Note: As an alternative to hand editing this file you can use the 
      web admin tool to configure settings for your application. Use
      the Website-&gt;Asp.Net Configuration option in Visual Studio.
      A full list of settings and comments can be found in 
      machine.config.comments usually located in 
      \Windows\Microsoft.Net\Framework\v2.x\Config 
  --&gt;
  &lt;configuration&gt;
      &lt;configSections&gt;
          &lt;!--&lt;section name="uri" type="System.Configuration.UriSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;--&gt;
          &lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler" requirePermission="false"/&gt;
          &lt;section name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection" requirePermission="false" allowLocation="true"/&gt;
      &lt;/configSections&gt;
      &lt;!-- The uri section is necessary to turn on .NET 3.5 support for IDN (international domain names),
           which is necessary for OpenID urls with unicode characters in the domain/host name. 
           It is also required to put the Uri class into RFC 3986 escaping mode, which OpenID and OAuth require. --&gt;
      &lt;uri&gt;
          &lt;idn enabled="All"/&gt;
          &lt;iriParsing enabled="true"/&gt;
      &lt;/uri&gt;
      &lt;system.net&gt;
          &lt;defaultProxy enabled="true"/&gt;
          &lt;settings&gt;
              &lt;!-- This setting causes .NET to check certificate revocation lists (CRL) 
                   before trusting HTTPS certificates.  But this setting tends to not 
                   be allowed in shared hosting environments. --&gt;
              &lt;servicePointManager checkCertificateRevocationList="false"/&gt;
          &lt;/settings&gt;
      &lt;/system.net&gt;
      &lt;!-- this is an optional configuration section where aspects of dotnetopenauth can be customized --&gt;
      &lt;dotNetOpenAuth&gt;
          &lt;messaging&gt;
              &lt;untrustedWebRequest&gt;
                  &lt;whitelistHosts&gt;
                      &lt;!--&lt;add name="localhost" /&gt;--&gt;
                  &lt;/whitelistHosts&gt;
              &lt;/untrustedWebRequest&gt;
          &lt;/messaging&gt;
          &lt;openid&gt;
              &lt;relyingParty&gt;
                  &lt;security requireSsl="false"&gt;
                      &lt;!-- Uncomment the trustedProviders tag if your relying party should only accept positive assertions from a closed set of OpenID Providers. --&gt;
                      &lt;!--&lt;trustedProviders rejectAssertionsFromUntrustedProviders="true"&gt;
                          &lt;add endpoint="https://www.google.com/accounts/o8/ud" /&gt;
                      &lt;/trustedProviders&gt;--&gt;
                  &lt;/security&gt;
                  &lt;behaviors&gt;
                      &lt;!-- The following OPTIONAL behavior allows RPs to use SREG only, but be compatible
                           with OPs that use Attribute Exchange (in various formats). --&gt;
                      &lt;add type="DotNetOpenAuth.OpenId.Behaviors.AXFetchAsSregTransform, DotNetOpenAuth"/&gt;
                  &lt;/behaviors&gt;
                  &lt;store type="RelyingPartyLogic.RelyingPartyApplicationDbStore, RelyingPartyLogic"/&gt;
              &lt;/relyingParty&gt;
          &lt;/openid&gt;
          &lt;oauth&gt;
              &lt;serviceProvider&gt;
                  &lt;store type="RelyingPartyLogic.NonceDbStore, RelyingPartyLogic"/&gt;
              &lt;/serviceProvider&gt;
          &lt;/oauth&gt;
          &lt;!-- Allow DotNetOpenAuth to publish usage statistics to library authors to improve the library. --&gt;
          &lt;reporting enabled="false"/&gt;
      &lt;/dotNetOpenAuth&gt;
      &lt;!-- log4net is a 3rd party (free) logger library that DotNetOpenAuth will use if present but does not require. --&gt;
      &lt;log4net&gt;
          &lt;appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender"&gt;
              &lt;bufferSize value="100"/&gt;
              &lt;connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
              &lt;connectionString value="Data Source=vs-SQLDev;Initial Catalog=Portal;Persist Security Info=True;User ID=***;Password=***;Enlist=False"/&gt;
              &lt;commandText value="INSERT INTO [Log] ([Date],[Thread],[Level],[Logger],[Message],[Exception]) VALUES (@log_date, @thread, @log_level, @logger, @message, @exception)"/&gt;
              &lt;parameter&gt;
                  &lt;parameterName value="@log_date"/&gt;
                  &lt;dbType value="DateTime"/&gt;
                  &lt;layout type="log4net.Layout.RawTimeStampLayout"/&gt;
              &lt;/parameter&gt;
              &lt;parameter&gt;
                  &lt;parameterName value="@thread"/&gt;
                  &lt;dbType value="String"/&gt;
                  &lt;size value="255"/&gt;
                  &lt;layout type="log4net.Layout.PatternLayout"&gt;
                      &lt;conversionPattern value="%thread"/&gt;
                  &lt;/layout&gt;
              &lt;/parameter&gt;
              &lt;parameter&gt;
                  &lt;parameterName value="@log_level"/&gt;
                  &lt;dbType value="String"/&gt;
                  &lt;size value="50"/&gt;
                  &lt;layout type="log4net.Layout.PatternLayout"&gt;
                      &lt;conversionPattern value="%level"/&gt;
                  &lt;/layout&gt;
              &lt;/parameter&gt;
              &lt;parameter&gt;
                  &lt;parameterName value="@logger"/&gt;
                  &lt;dbType value="String"/&gt;
                  &lt;size value="255"/&gt;
                  &lt;layout type="log4net.Layout.PatternLayout"&gt;
                      &lt;conversionPattern value="%logger"/&gt;
                  &lt;/layout&gt;
              &lt;/parameter&gt;
              &lt;parameter&gt;
                  &lt;parameterName value="@message"/&gt;
                  &lt;dbType value="String"/&gt;
                  &lt;size value="4000"/&gt;
                  &lt;layout type="log4net.Layout.PatternLayout"&gt;
                      &lt;conversionPattern value="%message"/&gt;
                  &lt;/layout&gt;
              &lt;/parameter&gt;
              &lt;parameter&gt;
                  &lt;parameterName value="@exception"/&gt;
                  &lt;dbType value="String"/&gt;
                  &lt;size value="2000"/&gt;
                  &lt;layout type="log4net.Layout.ExceptionLayout"/&gt;
              &lt;/parameter&gt;
          &lt;/appender&gt;
          &lt;!-- Setup the root category, add the appenders and set the default level --&gt;
          &lt;root&gt;
              &lt;level value="WARN"/&gt;
              &lt;appender-ref ref="AdoNetAppender"/&gt;
          &lt;/root&gt;
          &lt;!-- Specify the level for some specific categories --&gt;
          &lt;logger name="DotNetOpenAuth"&gt;
              &lt;level value="WARN"/&gt;
          &lt;/logger&gt;
          &lt;logger name="DotNetOpenAuth.OpenId"&gt;
              &lt;level value="INFO"/&gt;
          &lt;/logger&gt;
          &lt;logger name="DotNetOpenAuth.OAuth"&gt;
              &lt;level value="INFO"/&gt;
          &lt;/logger&gt;
      &lt;/log4net&gt;
      &lt;appSettings/&gt;
      &lt;connectionStrings&gt;
          &lt;!-- Remember to keep this connection string in sync with the one (if any) that appears in the log4net section. --&gt;
          &lt;add name="DatabaseEntities" connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;Data Source=vs-SQLDev;Initial Catalog=Portal;Persist Security Info=True;User ID=***;Password=***;Enlist=False&amp;quot;" providerName="System.Data.EntityClient"/&gt;
      &lt;/connectionStrings&gt;
      &lt;system.web&gt;
          &lt;!-- 
              Set compilation debug="true" to insert debugging 
              symbols into the compiled page. Because this 
              affects performance, set this value to true only 
              during development.
          --&gt;
          &lt;compilation debug="true" targetFramework="4.0"&gt;
              &lt;assemblies&gt;
                  &lt;remove assembly="DotNetOpenAuth.Contracts"/&gt;
                  &lt;add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/&gt;
                  &lt;add assembly="System.Web.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/&gt;&lt;/assemblies&gt;
          &lt;/compilation&gt;
          &lt;!--
              The &lt;authentication&gt; section enables configuration 
              of the security authentication mode used by 
              ASP.NET to identify an incoming user. 
          --&gt;
          &lt;authentication mode="Forms"&gt;
              &lt;forms loginUrl="~/login.aspx" name="Portal"/&gt; 
          &lt;/authentication&gt;
          &lt;!--
              The &lt;customErrors&gt; section enables configuration 
              of what to do if/when an unhandled error occurs 
              during the execution of a request. Specifically, 
              it enables developers to configure html error pages 
              to be displayed in place of a error stack trace.
              --&gt;
          &lt;customErrors mode="RemoteOnly"/&gt;
          &lt;httpModules&gt;
              &lt;add name="OAuthAuthenticationModule" type="RelyingPartyLogic.OAuthAuthenticationModule, RelyingPartyLogic"/&gt;
              &lt;add name="Database" type="RelyingPartyLogic.Database, RelyingPartyLogic"/&gt;
          &lt;/httpModules&gt;
          &lt;roleManager enabled="true" defaultProvider="Database"&gt;
              &lt;providers&gt;
                  &lt;add name="Database" type="RelyingPartyLogic.DataRoleProvider, RelyingPartyLogic"/&gt;
              &lt;/providers&gt;
          &lt;/roleManager&gt;
          &lt;pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/&gt;&lt;/system.web&gt;
      &lt;!-- 
          The system.webServer section is required for running ASP.NET AJAX under Internet
          Information Services 7.0.  It is not necessary for previous version of IIS.
      --&gt;
      &lt;system.webServer&gt;
          &lt;modules&gt;
              &lt;add name="OAuthAuthenticationModule" type="RelyingPartyLogic.OAuthAuthenticationModule, RelyingPartyLogic"/&gt;
              &lt;add name="Database" type="RelyingPartyLogic.Database, RelyingPartyLogic"/&gt;
          &lt;/modules&gt;
      &lt;/system.webServer&gt;
      &lt;system.serviceModel&gt;
          &lt;behaviors&gt;
              &lt;serviceBehaviors&gt;
                  &lt;behavior name="DataApiBehavior"&gt;
                      &lt;serviceMetadata httpGetEnabled="true"/&gt;
                      &lt;serviceDebug includeExceptionDetailInFaults="true"/&gt;
                      &lt;serviceAuthorization serviceAuthorizationManagerType="OAuthAuthorizationManager, __code" principalPermissionMode="Custom"/&gt;
                  &lt;/behavior&gt;
              &lt;/serviceBehaviors&gt;
          &lt;/behaviors&gt;
          &lt;services&gt;
              &lt;!--&lt;service behaviorConfiguration="DataApiBehavior" name="DataApi"&gt;
              &lt;/service&gt;--&gt;
          &lt;/services&gt;
      &lt;/system.serviceModel&gt;
      &lt;location path="default.aspx"&gt;
          &lt;system.web&gt;
              &lt;authorization&gt;
                  &lt;allow users="*"/&gt;
              &lt;/authorization&gt;
          &lt;/system.web&gt;
      &lt;/location&gt;
  &lt;/configuration&gt;
  </code></pre>