我目前正試圖運行一個C#程序,該程序是在Windows CE v6.0機器上使用Microsoft Visual C#2005創建的這是一個條形碼掃描儀/掌上電腦是一個控制檯程序,但是當我運行程序時,我發現了錯誤:。獲取錯誤「文件或程序集名稱」MySql.Data,版本= 6.7.4.0 ...'
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
檔案: 210
<?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中有相關的程序集? –