xamarin 有没有办法解决/更新旧的System.Runtime.Loader?[副本]

1sbrub3j  于 2023-08-01  发布在  其他
关注(0)|答案(1)|浏览(126)

此问题已在此处有答案

Can I create a cross-platform app with Xamarin using a MySQL database?(2个答案)
43分钟前关闭
我在让我的Xamarin应用程序连接到我的服务器时遇到了困难。
当我尝试运行这段代码时:

try
        {
            // connect to the mySQL server
            MySqlConnection connection = new MySqlConnection(connectionString);

            // create an open connection (this logs into the server)
            connection.Open();

字符串
我在连接时遇到错误。Open();然后抛出以下异常:

MySql.Data.MySqlClient.MySqlPoolManager' threw an exception.-   
$exception  {System.TypeInitializationException: The type initializer for 'MySql.Data.MySqlClient.MySqlPoolManager' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.Loader, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies,


看起来我丢失了一个名为System.Runtime.Loader的文件,版本为4。在检查资产后,我发现我有这个文件,但它的版本是旧的1.0.24212.1。我可以采取哪些步骤来尝试解决此问题?

nsc4cvqm

nsc4cvqm1#

我能够让程序运行的金块包@杰森提到here。以这种方式连接到SQL是不明智的,因为您的程序可能会被反编译,并且您的服务器信息会被盗。

相关问题