0

我们已经升级了要使用的应用程序,Microsoft.Data.SqlClient因为System.Data.SqlClient我们需要 Always Encrypted 支持。但是,在升级时,它会抛出一个异常 open 试图创建一个新的SqlConnection. 我尝试了各种连接字符串风格的排列,但没有任何帮助。

using (var conn = new SqlConnection(@"Server=MyServer;Database=MyDb;Connect Timeout=60; uid=admin;pwd=password") //Throws XmlException - "Root element is missing"
{
    conn.Open(); 
}

堆栈跟踪(不是很有帮助)

This exception was originally thrown at this call stack:
    System.Xml.XmlTextReaderImpl.Throw(System.Exception)
    System.Xml.XmlTextReaderImpl.ParseDocumentContent()
    System.Xml.XmlTextReaderImpl.Read()
    System.Xml.XmlTextReader.Read()
    System.Configuration.XmlUtil.XmlUtil(System.IO.Stream, string, bool, System.Configuration.ConfigurationSchemaErrors)
    System.Configuration.BaseConfigurationRecord.InitConfigFromFile()

有想法该怎么解决这个吗?

4

0 回答 0