Visual Studio连线MySQL问题_解决办法

问题描述:

使用Visual Studio连线MySQL出现报错
错误讯息如下
「System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Security.Permissions, Version=0.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. 系统找不到指定的档案。'」

https://ithelp.ithome.com.tw/upload/images/20210726/201398850EZHwXbLYg.png

已经正确引入MySQL.Data.dll档案,不过仍未能执行。
https://ithelp.ithome.com.tw/upload/images/20210726/20139885KYj6n9NdAR.png

解决办法:

错误讯息为「无法找到System.Security.Permissions的档案」,因此使用Nuget下载缺少的档案。
使用「工具」> 「NuGet套件管理员」 > 「案件管理主控台」
https://ithelp.ithome.com.tw/upload/images/20210726/20139885McHaNwVvYw.png

在下方「套件管理主控台」,输入
Install-Package System.Security.Permissions -Version 6.0.0-preview.6.21352.12

https://ithelp.ithome.com.tw/upload/images/20210726/20139885yKFGwuv7ZR.png

输入内容可参考
https://www.nuget.org/packages/System.Security.Permissions/6.0.0-preview.6.21352.12

将需下载档案输入搜寻即可复制要输入的code
https://ithelp.ithome.com.tw/upload/images/20210726/201398857B3JWDOpM8.png

Visual Studio下载完成後,依个人经验会再出现几个类似报错,
再依照同样方式处理後,直到缺少的档案都下载後就可以正常执行MySQL了。


<<:  Advance Outsourcing Accounting Service in Uk

>>:  获得资讯系统运行授权(authorization)而应首先开发的文件-安全和隐私计划(Security and privacy plans)

使用MongoDB -- 资料库简易上手

1. 注册及登入mongo database 2. Altas 点这边 之後应该会出现这个画面 点击...

Day 20 - 天眼CNN 的耳朵和嘴巴 - RNN(1) -传统RNN

CNN 与 RNN 之间的差异? 1982 年在由大卫.赫索霍夫主演的电视影集《霹雳游侠》里,能自动...

Day 07 | 互动事件

互动事件顾名思义,就是前後端之间的互动啦!现在要从页面上触发後端的 Function 不用在自己写 ...

DAY5 Messaging API 设定

要开发LINE Bot前,首先需建立一个Provider,也就是服务提供者,主要用来让LINE官方能...

React Native Fastlane

Setting Up fastlane Install Homebrew $ /usr/bin/ru...