我正在尝试使用类似于以下内容的连接字符串通过实体框架连接到 Azure SQL 数据库:
Data Source=<server>.database.windows.net;Authentication=Active Directory Integrated;Initial Catalog=<database>
连接尝试是在 AutoCAD 2018 内运行的托管 WPF 表单的上下文中进行的。该项目是使用 .NET Framework 4.6 和 EF 6.1.3 构建的。
我遇到以下错误:
Unable to load adalsql.dll (Authentication=ActiveDirectoryIntegrated). Error code: 0x2. For more information, see http://go.microsoft.com/fwlink/?LinkID=513072
不幸的是,帮助链接不会指向提供此问题的技术详细信息的页面。到目前为止,我还没有在网上发现任何可以阐明根本原因的信息。
我也尝试过这个连接字符串:
Server=tcp:<server>.database.windows.net,1433;Initial Catalog=<database>;Persist Security Info=False;User ID=<username>;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication="Active Directory Integrated"
它是从 Azure 门户复制的ADO.NET (Active Directory integrated authentication)
部分。但是,使用此连接字符串我收到以下错误Cannot use 'Authentication=Active Directory Integrated' with 'User ID', 'UID', 'Password' or 'PWD' connection string keywords
但它不包含密码段。删除后User ID
段,我仍然明白Unable to load adalsql.dll ...
error.