gpt4 book ai didi

asp.net - 错误 500.19 无法读取配置节 'oracle.manageddataaccess.client',因为它缺少节声明

转载 作者:行者123 更新时间:2023-12-02 16:16:06 31 4
gpt4 key购买 nike

我是 IIS 新手,我正在尝试在服务器的 IIS 上安装 Web 应用程序,但在运行时它显示一条消息“配置部分 'oracle.manageddataaccess.client' 不能阅读,因为它缺少节声明”,当我将它安装到我的计算机上时(如果它有效),但是当我将它传递到服务器时,它会向我发送消息,我的应用程序是在 asp mvc 中制作的,并且我连接到 Oracle 数据库 11g

enter image description here

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

这是我的网络配置

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

最佳答案

使用<oracle.manageddataaccess.client> web.config 中的元素,需要将其注册为 <section><sectionGroup>里面的元素 <configSections> 。您应该取消注释这部分,因为在您的示例中它仍然注释:

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

如果取消注释该行仍然不起作用,请将其更改为 <sectionGroup>元素:

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

还要确保 ODP 托管数据访问已在您的项目和/或 GAC(全局程序集缓存)中注册为程序集引用。

关于asp.net - 错误 500.19 无法读取配置节 'oracle.manageddataaccess.client',因为它缺少节声明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52859728/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com