Estou migrando para o Visual Studio 2017 um projeto legado que utiliza uma janela modal para coletar dados de conexão ao banco de dados e formatar uma string de conexão.
O código abaixo apresenta um erro:
var dialog = new DataConnectionDialog();
Could not load file or assembly 'Microsoft.Data.ConnectionUI, Version=0.0.0.0, Culture=neutral, PublicKeyToken=f4ca07f51760da93' or one of its dependencies. The system cannot find the file specified.: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Data.ConnectionUI, Version=0.0.0.0, Culture=neutral, PublicKeyToken=f4ca07f51760da93' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.Data.ConnectionUI, Version=0.0.0.0, Culture=neutral, PublicKeyToken=f4ca07f51760da93' at Microsoft.Data.ConnectionUI.DataConnectionDialog..ctor() at Wings4CloudPackage.Forms.frmNewSolution.btnDatabase_Click(Object sender, EventArgs e)
=== Pre-bind state information === LOG: DisplayName = Microsoft.Data.ConnectionUI, Version=0.0.0.0, Culture=neutral, PublicKeyToken=f4ca07f51760da93 (Fully-specified) LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/ LOG: Initial PrivatePath = NULL Calling assembly : Microsoft.Data.ConnectionUI.Dialog, Version=0.0.0.0, Culture=neutral, PublicKeyToken=f4ca07f51760da93. === LOG: This bind starts in LoadFrom load context. WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
Eu já verifiquei o diretório: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/
e a dll referenciada (Microsoft.Data.ConnectionUI.dll
) está lá.
O projeto usa o seguinte pacote nuget para exibir a caixa de diálogo: DataConnectionDialog (https://www.nuget.org/packages/DataConnectionDialog/1.1.0)
Esse código funciona no VS2013, mas não no VS2017.