C# – Problem regarding c#.net application communication with MySql

cdatabaseMySQLnetwindows

I am Developing a Desktop Application with c# .net and MySql as Database. It's an encryption application which produces an exe file which communicates with MySql to bring some data. I am using the MySql.Data.dll for application communication with MySql. When it produces exe there is no MySql.data.dll with it so it throws an error:

Could not load file or assembly 'MySql.Data, Version=6.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.

Best Answer

Set the Copy Local Attribute of the assembly reference ( MySql.Data.dll ) to true. That makes the reference copy itself to the output directory.