I'm Creating a Desktop Application with c# .internet and MySql as Database. This is an file encryption application which produces an exe file which conveys with MySql to create some data. I'm while using MySql.Data.dll for application communication with MySql. If this produces exe there's no MySql.data.dll by using it therefore it throws a mistake:

Couldn't load file or set up 'MySql.Data, Version=6.2.2., Culture=neutral, PublicKeyToken=c5687fc88969c44d' a treadmill of their dependencies. The machine cannot discover the file specified.

Set the Copy Local Attribute from the set up reference ( MySql.Data.dll ) to true. Which makes the reference copy itself towards the output directory.

You have to copy the MySql.Data.dll in to the same directory where the application will execute. E.g. the runtime folder.

Quite simply: Sooner or later you needed to locate the MySql.Data.dll for doing things inside your project's client code. Simply think it is again and copy it towards the runtime folder: /bin/debug for instance

You must do as psasik mentioned. If you're to redistribute the applying you will want to include the dll towards the setup project and you will always employ an MSBuild task copying the dll throughout debugging (or simply let it rest within the binDebug directory)