当我执行独立程序时,它崩溃并显示:
Exception: System.IO.FileNotFoundException: cannot find assembly or file Mysql.Data or load one of the dependable sources at project3.class.executesend<> at project3.class.initialize<> at project3.class.main<>
经过一番搜索,我发现我应该将这些 .dll
文件添加为程序的资源。我这样做之后,它产生了同样的错误。
我该如何解决这个问题?
最佳答案
如果我没理解错的话,您在项目的引用文件夹中添加了 Mysql.Data。
现在,在 VS Explorer 中右键单击它,转到属性,并将属性“Copy Local”设置为 true。
因此,每当您构建应用程序时,它都会被复制到“debug”或“release”文件夹中。
关于c# - 异常 : system. IO.FileNotFoundException : cannot find assembly or file Mysql. 数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14635497/