Devart.Data.MySql 'Feature is not supported.' 错误
Devart.Data.MySql 'Feature is not supported.' Error
我一直在拼命寻找一种方法来通知客户端数据库中的更改。
我尝试了 TableDependency 包,但后来发现它使用 SQL 而不是 MYSQL。
我偶然发现了 Devart,他们也有同样的东西。我已经安装了这个包并设置了一些代码来测试当数据库发生变化时它是否真的收到通知。但是当我尝试 运行 它 returns 我例外:
Devart.Common.LicenseException: 'Feature is not supported.
这是我用于测试的代码:
namespace WpfApp2
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public string connectionString = @"server=198.23.60.117;user=*******;database=*******;password=*******";
public MainWindow()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
Devart.Data.MySql.MySqlConnection DependencyConn = new Devart.Data.MySql.MySqlConnection(connectionString);
Devart.Data.MySql.MySqlCommand FriendsDependencyCommand = new Devart.Data.MySql.MySqlCommand("SELECT user_two FROM friends WHERE user_one=@username", DependencyConn);
MySqlDependency dependency = new MySqlDependency(FriendsDependencyCommand, 100);
dependency.OnChange += new OnChangeEventHandler(dependency_OnChange);
DependencyConn.Open();
MySqlDependency.Start(connectionString);
}
void dependency_OnChange(object sender, Devart.Data.MySql.MySqlTableChangeEventArgs e)
{
MessageBox.Show("Database Changes Detected.");
}
}
public class Customer
{
public string Username { get; set; }
}
}
我应该有所需的依赖项,我使用 NuGet 包管理器安装了包。
有线索吗?非常感谢。
MySQL 的 dotConnect 当前实现包括两个版本的程序集:
1) 安装时附带的 .NET Framework Devart.* 程序集:
* 程序集创建于 C:\Program Files (x86)\Devart\dotConnect/MySQL\(默认)
* 许可方法在 https://www.devart.com/dotconnect/mysql/docs/?Licensing.html
中进行了描述
2) .NET Standard (.NET Core) Devart.* 程序集,可通过 NuGet 获得:
* 您可以从 https://www.nuget.org/packages/devart.data.mysql
下载软件包
* 许可方法在 https://www.devart.com/dotconnect/mysql/docs/?LicensingStandard.html
中进行了描述
"Devart.Common.LicenseException: 'Feature is not supported.'" 错误表示运行时无法找到 .NET Standard Devart.* 程序集的许可证文件(或许可证密钥连接字符串参数)。参考https://www.devart.com/dotconnect/mysql/docs/?LicensingStandard.html.
我一直在拼命寻找一种方法来通知客户端数据库中的更改。
我尝试了 TableDependency 包,但后来发现它使用 SQL 而不是 MYSQL。 我偶然发现了 Devart,他们也有同样的东西。我已经安装了这个包并设置了一些代码来测试当数据库发生变化时它是否真的收到通知。但是当我尝试 运行 它 returns 我例外:
Devart.Common.LicenseException: 'Feature is not supported.
这是我用于测试的代码:
namespace WpfApp2
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public string connectionString = @"server=198.23.60.117;user=*******;database=*******;password=*******";
public MainWindow()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
Devart.Data.MySql.MySqlConnection DependencyConn = new Devart.Data.MySql.MySqlConnection(connectionString);
Devart.Data.MySql.MySqlCommand FriendsDependencyCommand = new Devart.Data.MySql.MySqlCommand("SELECT user_two FROM friends WHERE user_one=@username", DependencyConn);
MySqlDependency dependency = new MySqlDependency(FriendsDependencyCommand, 100);
dependency.OnChange += new OnChangeEventHandler(dependency_OnChange);
DependencyConn.Open();
MySqlDependency.Start(connectionString);
}
void dependency_OnChange(object sender, Devart.Data.MySql.MySqlTableChangeEventArgs e)
{
MessageBox.Show("Database Changes Detected.");
}
}
public class Customer
{
public string Username { get; set; }
}
}
我应该有所需的依赖项,我使用 NuGet 包管理器安装了包。
有线索吗?非常感谢。
MySQL 的 dotConnect 当前实现包括两个版本的程序集:
1) 安装时附带的 .NET Framework Devart.* 程序集:
- * 程序集创建于 C:\Program Files (x86)\Devart\dotConnect/MySQL\(默认)
- * 许可方法在 https://www.devart.com/dotconnect/mysql/docs/?Licensing.html
2) .NET Standard (.NET Core) Devart.* 程序集,可通过 NuGet 获得:
- * 您可以从 https://www.nuget.org/packages/devart.data.mysql
- * 许可方法在 https://www.devart.com/dotconnect/mysql/docs/?LicensingStandard.html
"Devart.Common.LicenseException: 'Feature is not supported.'" 错误表示运行时无法找到 .NET Standard Devart.* 程序集的许可证文件(或许可证密钥连接字符串参数)。参考https://www.devart.com/dotconnect/mysql/docs/?LicensingStandard.html.