奇怪的例外出来OdbcConnection.Open的() [英] Strange exception coming out of OdbcConnection.Open()

查看:163
本文介绍了奇怪的例外出来OdbcConnection.Open的()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

非难一下我们的头靠在墙上这里

Bashing our heads against the wall here

我们是一个独立软件开发商,并有数以百计的使用我们的软件,没有任何问题的公司。该软件的WinForms / C#.NET的2.0。

We are an ISV and have hundreds of companies using our software with no problems. The software is Winforms/C# on .NET 2.0.

我们的一个客户安装了我们的软件和崩溃在启动时对所有的机器,除了对一个人的的笔记本电脑,它工作正常。

One of our clients has installed our software and it crashes on startup on all of their machines, apart from on one guy's laptop where it works fine.

在调用OdbcConnection.Open(),我们可以得到以下异常:

On calling OdbcConnection.Open(), we get the following exception:

The type initializer for 'System.Transactions.Diagnostics.DiagnosticTrace' threw an exception.
  at System.Transactions.Diagnostics.DiagnosticTrace.get_Verbose()
  at System.Transactions.Transaction.get_Current()
  at System.Data.Common.ADP.IsSysTxEqualSysEsTransaction()
  at System.Data.Common.ADP.NeedManualEnlistment()
  at System.Data.Odbc.OdbcConnection.Open()
  at OurCompany.OurForm.connectionTestWorker_DoWork(Object sender)

这有一个的InnerException:

This has an InnerException:

Configuration system failed to initialize
  at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
  at System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(String sectionName)
  at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
  at System.Configuration.ConfigurationManager.GetSection(String sectionName)
  at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)
  at System.Diagnostics.DiagnosticsConfiguration.GetConfigSection()

谷歌只是说:是的app.config语法不正确,重建它,但同样的app.config工作正常数以百计的其他机器。

Google just says "app.config is syntactically incorrect, rebuild it" yet the same app.config works fine on hundreds of other machines.

下面是app.config中,根据要求:

Here's app.config, as requested:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
      <section name="OurApp.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    </sectionGroup>
  </configSections>
  <system.diagnostics>
  </system.diagnostics>
  <applicationSettings>
    <OurApp.Properties.Settings>
      <setting name="OurApp_WebServices_OurServiceName" serializeAs="String">
        <value>http://ourdomain.com/OurService.asmx</value>
      </setting>
    </OurApp.Properties.Settings>
  </applicationSettings>
  <appSettings>
    <add key="WorkflowEngine" value="old" />
    <add key="ProductID" value="3" />
    <add key="EnableMigrationWizard" value="false" />
    <add key="UseAlternativeFtpPort" value="true" />
    <add key="FeedbackWhileConnecting" value="true" />
  </appSettings>
</configuration>

有一个修复的.NET Framework并没有固定的这一点。我在全盘损失。任何想法?

A repair of the .NET Framework hasn't fixed this. I'm at a total loss. Any ideas?

推荐答案

通过覆盖machine.config中与另一台机器上已知的工作拷贝在同一个SP /补丁级别解决了这个。

Solved this by overwriting machine.config with a known working copy from another machine at the same SP/patch level.

这篇关于奇怪的例外出来OdbcConnection.Open的()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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