오류 500.19 'oracle.manageddataaccess.client' 구성 섹션에 섹션 선언이 없으므로 읽을 수 없습니다.
IIS를 처음 사용하는 경우 서버의 IIS에 웹 응용 프로그램을 마운트하려고 하는데 실행 중에 "구성 섹션 'oracle.manageddataaccess.client'가 섹션 선언이 누락되어 읽을 수 없습니다."라는 메시지가 표시됩니다. 작동하는 경우 컴퓨터에 마운트하지만 서버에 전달하면 해당 메시지가 표시됩니다.ge, 내 애플리케이션은 aspvc에서 만들어졌고 나는 오라클 데이터베이스 11g에 연결합니다.
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=\"Web\" /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="DATA SOURCE=localhost:1521/xe;PASSWORD=andres;USER ID=ANDRES"" 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="DATA SOURCE=myserver;PASSWORD=*******;USER ID=*******"" 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="DATA SOURCE=myserver;PASSWORD=*****;USER ID=*****"" 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="DATA SOURCE=myserver;PASSWORD=*****;USER ID=*****"" 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="DATA SOURCE=myserver;PASSWORD=*****;USER ID=*****"" 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="DATA SOURCE=myserver;PASSWORD=******;USER ID=******"" 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="DATA SOURCE=myserver;PASSWORD=*****;USER ID=******"" 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 Managed Data Access가 프로젝트 및/또는 GAC(Global Assembly Cache)에 어셈블리 참조로 이미 등록되어 있는지 확인합니다.
편집하는 대신web.config
수동으로 파일을 작성합니다. 응용프로그램을 사용할 수도 있습니다.OraProvCfg.exe
아래와 같은 스크립트를 실행합니다(시스템에 설치된 버전 선택).
set Oracle_x64=c:\oracle\product\12.1\Client_x64\odp.net
set Oracle_x86=c:\oracle\product\12.1\Client_x86\odp.net
set OraProvCfg_x64=%Oracle_x64%\bin\4\OraProvCfg.exe
set OraProvCfg_x86=%Oracle_x86%\bin\4\OraProvCfg.exe
set TNS_ADMIN=C:\oracle\network\admin
set CONFIGFILE_PATH=.../web.config
REM Delete configuration, if needed
"OraProvCfg_x64" /action:unconfig /product:odpm /frameworkversion:v4.0.30319 /configfile:%$CONFIGFILE_PATH%
"OraProvCfg_x86" /action:unconfig /product:odpm /frameworkversion:v4.0.30319 /configfile:%$CONFIGFILE_PATH%
REM Add configuration
"%OraProvCfg_x64%" /action:gac /providerpath:%Oracle_x64%\managed\common\Oracle.ManagedDataAccess.dll
"%OraProvCfg_x64%" /action:gac /providerpath:%Oracle_x64%\managed\PublisherPolicy\4\Policy.4.121.Oracle.ManagedDataAccess.dll
"%OraProvCfg_x64%" /action:gac /providerpath:%Oracle_x64%\managed\PublisherPolicy\4\Policy.4.122.Oracle.ManagedDataAccess.dll
"%OraProvCfg_x64%" /action:config /configfile:%$CONFIGFILE_PATH% /product:odpm /frameworkversion:v4.0.30319 /providerpath:%Oracle_x64%\managed\common\Oracle.ManagedDataAccess.dll /set:settings\TNS_ADMIN:%TNS_ADMIN%
"%OraProvCfg_x86%" /action:config /configfile:%$CONFIGFILE_PATH% /product:odpm /frameworkversion:v4.0.30319 /providerpath:%Oracle_x86%\managed\common\Oracle.ManagedDataAccess.dll /set:settings\TNS_ADMIN:%TNS_ADMIN%
건너뛸 경우/configfile:...
그러면 응용 프로그램이 전역을 수정합니다.machine.config
파일입니다 아마도 당신은 또한 구성해야 할 것입니다./product:aspnet
,달려.OraProvCfg.exe
그리고 출력물을 확인합니다.
Oracle Providers for .NET Configuration Utility for .NET Framework 4 : Release 4.122.1.0 Production on Do Okt 18 09:00:41 2018
Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
Usage:
OraProvCfg /action:<action>
[/force]
[/configfile:<app/web.config file path]
[/product:<product>]
[/component:<component name>]
[/productversion:<product version>]
[/frameworkversion:<.NET version>]
[/providerpath:<provider path>]
[/verbose:<verbose>]
[/log:<log file path>]
[/set:[*\]<section name>\<attribute name>:<attribute value>]
[/unset:[*\]<section name>\<attribute name>:<attribute value>]
<action> = gac | ungac | register | unregister |
config | unconfig
<configfile> = complete file path of app/web.config
for configuring/ unconfiguring odp/odpm/ASP.net entries only.
<product> = odp | odpm | aspnet
<component name> = oraclepermission | perfcounter |
dbproviderfactory
(for odp or odpm only)
= all (default) | membership | profile | sitemap
| rolemanager | personalization | webevent |
a combination (i.e. "membership|profile")
(for aspnet only)
<product version> = 4 digit assembly version number of the product
(i.e. 4.112.2.0)
<.NET version> = .NET Framework version
(i.e. v2.0.50727 or v4.0.30319)
<provider path> = full path location of the .NET assembly,
including the the assembly file name
(i.e. c:\OH\odp.net\bin\4\Oracle.DataAccess.dll)
<verbose> = true (default) | false
<log file name> = full path of the log file to log output
<section name> = subsection name of oracle.manageddataaccess
.client
(e.g.)distributedTransaction
<attribute name> = attribute name
(e.g.)oramts_sess_txntimetolive
<attribute value> = attribute value (e.g.)240
Oracle의 web.config 파일 편집을 수락하는 대신 직접 연결 문자열을 관리하는 것이 더 쉽습니다.
코멘트 아웃:<oracle.manageddataaccess.client>
및 그에 상응하는<configSections>
Oracle이 삽입하는 항목입니다.
대신 Microsoft를 사용합니다.<connectionStrings>
구성 관리자가 액세스할 수 있는 섹션
<connectionStrings> <clear/> <add name="DB_CONN_STRING" connectionString="Data Source=servername:1521/dbinstancename;User ID=user;Password=pwd;"/> </connectionStrings>
그런 다음 코드에서 다음과 연결:
using System.Configuration;
using Oracle.ManagedDataAccess.Client;
string conString = ConfigurationManager.ConnectionStrings["DB_CONN_STRING"].ConnectionString;
OracleConnection myConnection = new OracleConnection(conString);
myConnection.Open();
web.config에서 중복 선언에 대한 오류가 발생했기 때문에 <section name="section.manageddata access.client".../>를 사용하지 않도록 설정했을 수 있습니다.
이 문제를 해결하는 방법은 여러 가지가 있습니다.모든 사람이 machine.config(특히 서버에서)를 수정할 수 있는 고급스러움이나 욕구가 있는 것은 아닙니다.이 문제를 해결하는 가장 쉬운 방법은 웹.config(웹 응용 프로그램이 아닌 경우 app.config)에서 bindingRedirect를 사용하여 웹 응용 프로그램과 machine.config에 나열된 내용 간의 버전 충돌을 해결하는 것입니다.
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.122.21.1" newVersion="4.122.21.1"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
참고: 사용 중인 버전은4.122.21.1
사용 중인 자신의 버전과 일치해야 합니다.
참고: 리디렉션이 켜져 있습니다.Oracle.ManagedDataAccess
,것은 아니다.Oracle.ManagedDataAccess.Client
이것은 개발자들이 흔히 저지르는 실수입니다.
machine.config를 변경하려면 기계의 다른 앱에 예기치 않은 결과를 초래할 수 있으므로 신중하게 진행하십시오.가장 간단한 수정은 Oracle 버전을 변경하는 것입니다.관리 데이터 액세스.별표 "*"를 사용하여 강력한 버전에서 모든 버전으로 클라이언트 섹션을 구성합니다.
<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=*, Culture=neutral, PublicKeyToken=89b483f429c47342" />
추가적인 설명이 필요하시면 제게 알려주시면 더 자세한 내용을 말씀드릴 수 있습니다.
언급URL : https://stackoverflow.com/questions/52859728/error-500-19-the-configuration-section-oracle-manageddataaccess-client-cannot
'sourcecode' 카테고리의 다른 글
매크로에서 붙여넣은 토큰을 대문자로 바꿀 수 있습니까? (0) | 2023.08.07 |
---|---|
Get-ChildItem 결과 수 제한 (0) | 2023.08.07 |
ORA-00604 ORA-12705 (0) | 2023.08.07 |
mariadb 또는 mysql에서 json 배열 내의 요소를 찾고 삭제하는 방법 (0) | 2023.08.07 |
swift의 고유한 배열 (0) | 2023.08.07 |