3

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
  • and does it work if you put the missing file inside the release folder manually? Commented Sep 1, 2011 at 10:19

2 Answers 2

9

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.

Sign up to request clarification or add additional context in comments.

2 Comments

That did the trick, Regarding your last comment, is there a way to fix this, so the assembly will be shipped?
If you set copy local it should ship with the application. Ultimately it depends on how and where you deploy it though.
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.