运行构建.NET应用程序这需要MySql.Data [英] Running a built .NET application which required MySql.Data
问题描述
林有一个问题,运行这是我写的一个内置.NET应用程序:
Im having a problem running a built .NET application which I wrote:
我的应用程序使用的是安装在我的系统上最新的MySQL连接器,并显示为一个.NET 4 Framwork组件,当我尝试添加它作为参考。
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.
当我运行我在调试模式下的应用程序的一切伟大工程的环境, 但是当我尝试直接从释放文件夹中运行它作为一个独立的应用程序,我得到以下异常:
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:
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?
推荐答案
尝试:
- 在重建使用发布配置和检查,以确保MySQL.Data.dll是在你的发行版文件夹中。
- 右键单击该MySQL.Data参考,选择属性,并确保复制本地设置为true。
- 清洁并再次重建,并再次检查release文件夹。
这听起来像你的程序集是在全局程序集缓存,但不被随您的应用程序生成的输出。
It sounds like your assembly is in the global assembly cache but is not being shipped with your application build output.
这篇关于运行构建.NET应用程序这需要MySql.Data的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!