C# SEHExceptions/ConfigurationErrorsDBProviderFactorys中的SEHExceptions

C# SEHExceptions/ConfigurationErrorsDBProviderFactorys中的SEHExceptions,c#,C#,我已经寻找了至少3个小时的答案,但我没有找到任何东西。 我要注意的是,这种方法过去是有效的,但在SQLServer或VisualStudio方面没有涉及任何内容 模拟具有两台服务器的服务器;一个控制主服务器,一个控制访问/基础(登录和初始连接)。 他们过去能够访问数据库,并使用udl I确认与user/pass的连接是正确的 public Database(string connectionString, string providerName) { _factory = DbProvi

我已经寻找了至少3个小时的答案,但我没有找到任何东西。 我要注意的是,这种方法过去是有效的,但在SQLServer或VisualStudio方面没有涉及任何内容

模拟具有两台服务器的服务器;一个控制主服务器,一个控制访问/基础(登录和初始连接)。 他们过去能够访问数据库,并使用udl I确认与user/pass的连接是正确的

public Database(string connectionString, string providerName)
{
    _factory = DbProviderFactories.GetFactory(providerName); // This throws the exception(s)
    _com = _factory.CreateCommand();
    _con = _factory.CreateConnection();
    _con.ConnectionString = connectionString;
    _com.Connection = _con;
}
例外情况如下:

External Component has thrown an exception (System.Runtime.InteropServices.SEHException)

A System.Configuration.ConfigurationErrorsException has occurred
An Error occurred creating the configuration section handler for system.data: 
External Component has thrown an exception
配置是

<add name="Database"
    connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=Database;User Id=;Password=pass;Trusted_Connection=True;"
     providerName="System.Data.SqlClient"/>

就像我说的,这过去是有效的,没有任何改变。唯一的例外是Windows Update

我搜索了这两个错误,ConfigurationErrorsException只说配置是错误的,但自上次工作构建以来,配置没有更改。 而SEHException也可能是微软说他们自己不知道


如果有人最近或过去有过这个问题,如果他们能帮上忙就好了。。。即使它与问题无关,但有相同的例外情况/结果。

在有人发言之前,我检查了以前的版本,他们的行为是一样的。这会是一个框架问题吗?没有人能帮忙吗?至少在我重新格式化之前,windows update 4.6可能已经重新排列了库