【发布时间】:2023-03-20 02:18:01
【问题描述】:
我目前正在尝试在 Windows CE v6.0 机器上运行我使用 Microsoft Visual C# 2005 创建的 C# 程序,该机器是条形码扫描仪/掌上电脑。这是一个控制台程序,但是当我运行该程序时,我得到了错误:
File or assembly name 'MySql.Data,Version=6.7.4.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D' , or one of its dependencies was not found.
看细节,是TypeLoadException。
这是我的app.manifest 文件:
<?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>
编辑 如果没有出现上述错误,则会出现另一个类似的错误:
File or assembly name 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089', or one of its dependencies, was not found.
【问题讨论】:
-
那么您是否在同一目录或 GAC 中有相关程序集?
标签: c# mysql .net visual-studio-2005 windows-ce