ORA-12154:TNS:无法在一种解决方案上解析服务名称,而在其他解决方案上则无法解析 [英] ORA-12154: TNS:could not resolve service name on one solution but no other

查看:119
本文介绍了ORA-12154:TNS:无法在一种解决方案上解析服务名称,而在其他解决方案上则无法解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的情况.

一些背景信息:我正在Vista 64位企业版计算机上进行开发.我安装了8.0.5、8.0.6、8.1.7、9.2.1和10G版本(我们支持某些真正的旧应用程序).我所有的工具(TOAD,sqlplus和Oracle SQL Developer)都解析TNS服务 名字就好.我已确保所有安装的所有ldap.ora,sqlnet.ora和tnsnames.ora文件都相同.我已经确定在oracle安装中以及我的解决方案中都没有路径包含().我可以TNSP输入我的服务名称 并在60ms或更短时间内解决.除了网站或WinForms之外,所有应用程序都可以使用非常相似的连接字符串很好地连接到oracle.

Some backround information: I am doing development on a Vista x64 Enterprise box. I have versions 8.0.5, 8.0.6, 8.1.7, 9.2.1 and 10G installed (we support some REALLY old apps). All of my tools (TOAD, sqlplus and Oracle SQL Developer) resolve TNS service names just fine. I have made sure that all ldap.ora, sqlnet.ora and tnsnames.ora files are identical for all installations. I have mades sure that no paths in the oracle installations have '()'s in them as well as my solutions. I can TNSPing my service name and it is resolved in 60ms or less. All applications whether websites or WinForms except this one connect to oracle just fine using very similar connection strings.

我有一个共享多个DLL的网站和Windows服务.每个都有其自己的解决方案. Windows服务还具有一个测试项目,该项目允许我(或应该)在不将其安装在我的盒子上的情况下测试该服务(我继承了这个东西,尽管它是 合理组织).当我运行网站时,可以正常连接到oracle.我已确保我的web.config和app.config文件的连接字符串部分相同.

I have a website and a windows service that share a number of DLLs. Each is in its own solution. The windows service also has a test project that allows me (or should) to test the service w/o installing it on my box (I inherited this thing, although it is reasonably organized). When I run the website I can connect to oracle just fine. I have made sure that the connection strings sections of my web.config and app.config files are identical.

在运行单元测试时尝试连接时,仍然出现ORA-12154错误.我不知所措.我搜索过的所有内容(请参阅上面的背景信息中已经完成的一些内容)都没有帮助.

I still get the ORA-12154 error when trying to connect when I run the unit tests. I am at a loss for a fix. All of the stuff that I've googled (see some of the stuff I've already done in the backround information above) have not helped.

有人有什么主意吗?

谢谢,迈克

推荐答案

我也有类似的经历中描述的问题 http://social.msdn.microsoft.com/Forums/zh-CN/vsunittest/thread/c980ce78-c29a-497f-8b1e-d6e648b0b852 .

I had a similar problem described in http://social.msdn.microsoft.com/Forums/en-US/vsunittest/thread/c980ce78-c29a-497f-8b1e-d6e648b0b852.

您的潜在问题听起来像特定于64位系统的Oracle错误,具体说明如下: http://www.oracle.com/technetwork/topics/dotnet/odt-faq-085407.html#ORA-12154:_TNS:could_not_resolve_the .运行单元测试的可执行文件位于C:\ Program Files(x86)下,并且路径中的括号引起混淆 甲骨文.

Your underlying problem sounds like an Oracle bug specific to 64-bit systems as described in http://www.oracle.com/technetwork/topics/dotnet/odt-faq-085407.html#ORA-12154:_TNS:could_not_resolve_the. The executable that runs the unit tests is located under C:\Program Files (x86) and the parens in the path confuse Oracle.

我卸载了Visual Studio(和相关程序),然后将其重新安装在C:\ Program Files VS下.由于我的应用程序使用.NET 3.5,因此我还必须按如下所述在ResGen.exe上设置32BIT标志. http://social.msdn.microsoft.com/Forums/en/msbuild/thread/e5900710-9849-4d10-aa28-48b734d06bf2   (使用解决方案的选项2).

I uninstalled Visual Studio (and related programs), then reinstalled it under C:\Program Files VS.  Since my application uses .NET 3.5, I also had to set the 32BIT flag on ResGen.exe as described in http://social.msdn.microsoft.com/Forums/en/msbuild/thread/e5900710-9849-4d10-aa28-48b734d06bf2 (using Option 2 of the solution).

希望这对您有所帮助.

吉姆


这篇关于ORA-12154:TNS:无法在一种解决方案上解析服务名称,而在其他解决方案上则无法解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆