Running a built .NET application which required MySql.Data

痞子三分冷 提交于 2019-12-10 19:24:33

问题


Im having a problem running a built .NET application which I wrote:

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?


回答1:


Try:

  1. Rebuild using release configuration and check to make sure that the MySQL.Data.dll is in your release folder.
  2. Right click the MySQL.Data reference, select properties and make sure that "copy local" is set to 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.




回答2:


Try to delete all occurrences of MySQL.data.dll in the temp folders of .net framework and see .



来源:https://stackoverflow.com/questions/7268924/running-a-built-net-application-which-required-mysql-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!