嗨,
我正在处理一个asp.net Web应用程序。 我已经下载了ODP.NET的最新版本来执行数据库活动。 现在我面临以下错误: 定义了重复的“ oracle.manageddataaccess.client”部分
我已经尝试了变通办法,以删除machine.config文件中的部分,但没有成功(https://www.oracle.com/technetwork/topics/dotnet/downloads/odpnet-managed-nuget-121021-2405792.txt)。
有人知道解决这个问题的其他可能性吗?
问候
答案 0 :(得分:0)
尝试使用此脚本删除所有条目:
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
set OraProvCfg_x86=%Oracle_x86%\bin\4\OraProvCfg
"OraProvCfg_x64" /action:config /force /product:odpm /frameworkversion:v4.0.30319 /productversion:4.121.1.0 /unset:settings\TNS_ADMIN
"OraProvCfg_x64" /action:config /force /product:odpm /frameworkversion:v4.0.30319 /productversion:4.121.2.0 /unset:settings\TNS_ADMIN
"OraProvCfg_x64" /action:config /force /product:odpm /frameworkversion:v4.0.30319 /productversion:4.122.1.0 /unset:settings\TNS_ADMIN
"OraProvCfg_x64" /action:config /force /product:odpm /frameworkversion:v4.0.30319 /productversion:4.122.18.3 /unset:settings\TNS_ADMIN
"OraProvCfg_x64" /action:unconfig /product:odpm /frameworkversion:v4.0.30319 /productversion:4.121.1.0
"OraProvCfg_x64" /action:unconfig /product:odpm /frameworkversion:v4.0.30319 /productversion:4.121.2.0
"OraProvCfg_x64" /action:unconfig /product:odpm /frameworkversion:v4.0.30319 /productversion:4.122.1.0
"OraProvCfg_x64" /action:unconfig /product:odpm /frameworkversion:v4.0.30319 /productversion:4.122.18.3
"OraProvCfg_x86" /action:config /force /product:odpm /frameworkversion:v4.0.30319 /productversion:4.121.1.0 /unset:settings\TNS_ADMIN
"OraProvCfg_x86" /action:config /force /product:odpm /frameworkversion:v4.0.30319 /productversion:4.121.2.0 /unset:settings\TNS_ADMIN
"OraProvCfg_x86" /action:config /force /product:odpm /frameworkversion:v4.0.30319 /productversion:4.122.1.0 /unset:settings\TNS_ADMIN
"OraProvCfg_x86" /action:config /force /product:odpm /frameworkversion:v4.0.30319 /productversion:4.122.18.3 /unset:settings\TNS_ADMIN
"OraProvCfg_x86" /action:unconfig /product:odpm /frameworkversion:v4.0.30319 /productversion:4.121.1.0
"OraProvCfg_x86" /action:unconfig /product:odpm /frameworkversion:v4.0.30319 /productversion:4.121.2.0
"OraProvCfg_x86" /action:unconfig /product:odpm /frameworkversion:v4.0.30319 /productversion:4.122.1.0
"OraProvCfg_x86" /action:unconfig /product:odpm /frameworkversion:v4.0.30319 /productversion:4.122.18.3
之后,您可以使用同一工具对其进行正确配置:
set TNS_ADMIN=C:\oracle\network\admin
IF EXIST "%Oracle_x64%\managed\common\Oracle.ManagedDataAccess.dll" "%OraProvCfg_x64%" /action:config /product:odpm /frameworkversion:v4.0.30319 /providerpath:%Oracle_x64%\managed\common\Oracle.ManagedDataAccess.dll /set:settings\TNS_ADMIN:%TNS_ADMIN%
IF EXIST "%Oracle_x86%\managed\common\Oracle.ManagedDataAccess.dll" "%OraProvCfg_x86%" /action:config /product:odpm /frameworkversion:v4.0.30319 /providerpath:%Oracle_x86%\managed\common\Oracle.ManagedDataAccess.dll /set:settings\TNS_ADMIN:%TNS_ADMIN%
更新
实际上,您可以删除所有较短的条目,
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
set OraProvCfg_x86=%Oracle_x86%\bin\4\OraProvCfg
"OraProvCfg_x86" /action:unconfig /product:odpm /frameworkversion:v4.0.30319
"OraProvCfg_x64" /action:unconfig /product:odpm /frameworkversion:v4.0.30319