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