简体   繁体   English

运行需要MySql.Data的内置.NET应用程序

[英]Running a built .NET application which required MySql.Data

Im having a problem running a built .NET application which I wrote: 我在运行构建的.NET应用程序时遇到问题,我写道:

My application uses the latest MySql connector which is installed on my system and shows up as a .NET 4 Framwork component when I try to add it as a reference. 我的应用程序使用安装在我的系统上的最新MySql连接器,当我尝试将其添加为参考时,它显示为.NET 4 Framwork组件。

When I run my application in debug mode in the environment everything works great, but when I try to run it as a stand alone application straight from the "release" folder, I get the following exception: 当我在环境中以调试模式运行我的应用程序时,一切都很好,但是当我尝试直接从“release”文件夹运行它作为独立应用程序时,我得到以下异常:

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or ass
embly 'MySql.Data, Version=6.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969
c44d' or one of its dependencies. The system cannot find the file specified.

Any idea how can I solve this? 知道怎么解决这个问题?

Try: 尝试:

  1. Rebuild using release configuration and check to make sure that the MySQL.Data.dll is in your release folder. 使用发布配置重建并检查以确保MySQL.Data.dll位于您的发布文件夹中。
  2. Right click the MySQL.Data reference, select properties and make sure that "copy local" is set to true. 右键单击MySQL.Data引用,选择属性并确保“copy local”设置为true。
  3. Clean and rebuild again and check the release folder again. 再次清理并重建并再次检查释放文件夹。

It sounds like your assembly is in the global assembly cache but is not being shipped with your application build output. 听起来你的程序集在全局程序集缓存中,但是不随应用程序构建输出一起提供。

尝试删除.net框架的临时文件夹中出现的所有MySQL.data.dll并查看。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM