Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error 500.19 The configuration section 'oracle.manageddataaccess.client' cannot be read because it is missing a section declaration

I'm new to IIS, I'm trying to mount a web application on the IIS of the server, but at the moment of running it shows me a message "The configuration section 'oracle.manageddataaccess.client' cannot be read because it is missing a section declaration", when I mount it on my computer if it works but when I pass it to the server it sends me the message , my application is made in asp mvc and I connect to the Oracle database 11g

enter image description here

 100:   </system.data>
  101:   <oracle.manageddataaccess.client>
  102:     <version number="*">

this is my webconfig

<?xml version="1.0" encoding="utf-8"?>
<!--
  Para obtener más información sobre cómo configurar la aplicación ASP.NET, visite
  https://go.microsoft.com/fwlink/?LinkId=301880
  -->
<configuration>
  <configSections>
    <!-- <section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />-->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
  </configSections>
  <appSettings>
    <add key="webpages:Version" value="3.0.0.0" />
    <add key="webpages:Enabled" value="false" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
  </appSettings>
  <system.web>
    <compilation targetFramework="4.5.2" />
    <httpRuntime targetFramework="4.5.2" />
    <httpModules>
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
    </httpModules>
  </system.web>
  <system.web>
    <authentication mode="Forms">
      <forms loginUrl="~/Account/Login" timeout="1" />
    </authentication>
  </system.web>
  <!--<system.web>
    <customErrors mode="On" >
      <error statusCode="404" redirect="~/Error/Error404" ></error>
      <error statusCode="500" redirect="~/Error/Error" ></error>
    </customErrors>
  </system.web>-->
  <!--<system.web>
    <roleManager enabled="true" />
  </system.web>-->
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" />
        <bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
        <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-1.6.5135.21930" newVersion="1.6.5135.21930" />
      </dependentAssembly>
      <dependentAssembly>
        <publisherPolicy apply="no" />
        <assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.6.0" newVersion="5.2.6.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <system.webServer>
    <!--<modules>
      <remove name="TelemetryCorrelationHttpModule" />
      <add name="TelemetryCorrelationHttpModule" type="Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule, Microsoft.AspNet.TelemetryCorrelation" preCondition="integratedMode,managedHandler" />
      <remove name="ApplicationInsightsWebTracking" />
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />
    </modules>
    -->
    <validation validateIntegratedModeConfiguration="false" />
  </system.webServer>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
    </compilers>
  </system.codedom>
  <system.data>
    <DbProviderFactories>
      <remove invariant="Oracle.ManagedDataAccess.Client" />
      <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
    </DbProviderFactories>
  </system.data>
  <oracle.manageddataaccess.client>
    <version number="*">
      <dataSources>
        <dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) " />
      </dataSources>
    </version>
  </oracle.manageddataaccess.client>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="v13.0" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="Oracle.ManagedDataAccess.Client" type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=6.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>
  <connectionStrings>
    <add name="ProductoEntities" connectionString="metadata=res://*/Models.ProductoModel.csdl|res://*/Models.ProductoModel.ssdl|res://*/Models.ProductoModel.msl;provider=Oracle.ManagedDataAccess.Client;provider connection string=&quot;DATA SOURCE=localhost:1521/xe;PASSWORD=andres;USER ID=ANDRES&quot;" providerName="System.Data.EntityClient" />
    <add name="MonterreyEntities" connectionString="metadata=res://*/Models.dbConnMonterrey.dbMonterreyModel.csdl|res://*/Models.dbConnMonterrey.dbMonterreyModel.ssdl|res://*/Models.dbConnMonterrey.dbMonterreyModel.msl;provider=Oracle.ManagedDataAccess.Client;provider connection string=&quot;DATA SOURCE=myserver;PASSWORD=*******;USER ID=*******&quot;" providerName="System.Data.EntityClient" />
    <add name="MonterreyProdEntities" connectionString="metadata=res://*/Models.dbMonterreyProduccion.dbMonterreyProdModel.csdl|res://*/Models.dbMonterreyProduccion.dbMonterreyProdModel.ssdl|res://*/Models.dbMonterreyProduccion.dbMonterreyProdModel.msl;provider=Oracle.ManagedDataAccess.Client;provider connection string=&quot;DATA SOURCE=myserver;PASSWORD=*****;USER ID=*****&quot;" providerName="System.Data.EntityClient" />
    <add name="MonterreyAndresEntities" connectionString="metadata=res://*/Models.dbMonterreyAndres.dbMonterreyAndresModel.csdl|res://*/Models.dbMonterreyAndres.dbMonterreyAndresModel.ssdl|res://*/Models.dbMonterreyAndres.dbMonterreyAndresModel.msl;provider=Oracle.ManagedDataAccess.Client;provider connection string=&quot;DATA SOURCE=myserver;PASSWORD=*****;USER ID=*****&quot;" providerName="System.Data.EntityClient" />
    <add name="dbMonterreyREPREGEREntities" connectionString="metadata=res://*/Models.dbMonterreyProduccion.dbMonterreyREPREGERProduccion.csdl|res://*/Models.dbMonterreyProduccion.dbMonterreyREPREGERProduccion.ssdl|res://*/Models.dbMonterreyProduccion.dbMonterreyREPREGERProduccion.msl;provider=Oracle.ManagedDataAccess.Client;provider connection string=&quot;DATA SOURCE=myserver;PASSWORD=*****;USER ID=*****&quot;" providerName="System.Data.EntityClient" />
    <add name="MonterreyPreProduccionEntities" connectionString="metadata=res://*/Models.dbMonterreyPreProduccion.dbMonterreyPreProduccionModel.csdl|res://*/Models.dbMonterreyPreProduccion.dbMonterreyPreProduccionModel.ssdl|res://*/Models.dbMonterreyPreProduccion.dbMonterreyPreProduccionModel.msl;provider=Oracle.ManagedDataAccess.Client;provider connection string=&quot;DATA SOURCE=myserver;PASSWORD=******;USER ID=******&quot;" providerName="System.Data.EntityClient" />
    <add name="MonterreyREPREGERPreProduccionEntities" connectionString="metadata=res://*/Models.dbMonterreyPreProduccion.dbMonterreyREPREGERPreProduccionModel.csdl|res://*/Models.dbMonterreyPreProduccion.dbMonterreyREPREGERPreProduccionModel.ssdl|res://*/Models.dbMonterreyPreProduccion.dbMonterreyREPREGERPreProduccionModel.msl;provider=Oracle.ManagedDataAccess.Client;provider connection string=&quot;DATA SOURCE=myserver;PASSWORD=*****;USER ID=******&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>
</configuration>
like image 728
andres martinez Avatar asked Oct 17 '18 16:10

andres martinez


1 Answers

To use <oracle.manageddataaccess.client> element in web.config, it is necessary to register it with <section> or <sectionGroup> element inside <configSections>. You should uncomment this part because in your example it still commented:

<section name="oracle.manageddataaccess.client" 
         type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />

If uncommenting that line still not working, change it to <sectionGroup> element:

<sectionGroup name="oracle.manageddataaccess.client" 
              type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />

Also make sure that ODP Managed Data Access is already registered as assembly reference in your project and/or GAC (Global Assembly Cache).

like image 71
Tetsuya Yamamoto Avatar answered Oct 30 '22 06:10

Tetsuya Yamamoto