0

I am currently trying to run a C# program which I created using Microsoft Visual C# 2005 on a Windows CE v6.0 Machine which is a barcode scanner/pocket PC. It is a console program, but when I run the program, I'm getting the error:

File or assembly name 'MySql.Data,Version=6.7.4.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D' , or one of its dependencies was not found.

Looking at the details, it is a TypeLoadException.

Here is my app.manifest file:

<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <applicationRequestMinimum>
        <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true" ID="Custom" SameSite="site" />
        <defaultAssemblyRequest permissionSetReference="Custom" />
      </applicationRequestMinimum>
    </security>
  </trustInfo>
    <system.data>
        <DbProviderFactories>
            <remove name="MySQL Data Provider" />
            <add name="MySQL Data Provider"
                invariant="MySql.Data.MySqlClient"
                description=".Net Framework Data Provider for MySQL"
                type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
        </DbProviderFactories>
    </system.data>
</asmv1:assembly>

EDIT If the error above doesn't appear, another similar one shows up:

File or assembly name 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089', or one of its dependencies, was not found.
1
  • Well do you have the relevant assembly in the same directory or in the GAC? Commented Feb 10, 2014 at 16:11

2 Answers 2

1

The error means that your application cannot find the ADO Data provider for MySQL that you specified when you created the app. Its most likely, you simply did not copy it over to your Windows CE machine.

To locate it: Go into your Visual Studio, and open the "References" under your project in the solution explorer. Find the Mysql entry and select it. The Properties window will identify the path to the dll.

Copy that dll into the same directory as your executable on the Win CE machine.

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

4 Comments

Thanks for this, now the error disapears but a similar one shows up. This time, the "System.Data Version 2.0.0.0 [...] was not found". Any idea how to fix that?
Did you install the .NET framework? System.**anything** is part of the framework.
I've tried by downloading a .cab file however it won't let me install it. Any ideas?
Not really familiar with Win CE, but this link looks promising: msdn.microsoft.com/en-us/library/bb788171%28v=vs.90%29.aspx
0

You could try to enable Fusion Log Viewer to see exactly which library is causing the problem (like described here: http://www.hanselman.com/blog/BackToBasicsUsingFusionLogViewerToDebugObscureLoaderErrors.aspx). It could happen that you will need to run it few times, if there are a batch of dll's missing

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.