我为移动设备创建了一个Windows CE应用程序。当我从VS调试应用程序时,应用程序加载并运行正常。但是,当我为安装构建CAB文件时,它没有。我第一次在安装它之后启动它,它会抛出一个“TypeLoadException”。但是,当我再试一次时它工作正常。
第一次尝试从应用程序访问DLL时,它会抛出错误。
我想发布你们需要的代码,但是我对相关内容有点不确定。这是我用来制作带有CABWIZ.exe的CAB文件的INF文件:
[Version]
Signature="$Windows NT$"
Provider="Y"
CESignature="$Windows CE$"
[CEStrings]
AppName="ShoePDA"
InstallDir="\Backup\XClient"
[Strings]
Manufacturer="Y"
[CEDevice]
VersionMin=4.0
VersionMax=6.99
BuildMax=0xE0000000
[DefaultInstall]
CEShortcuts=Shortcuts
AddReg=RegKeys
CopyFiles=Files.Common1,Files.Common2,Files.Common3,Files.Common4,Files.Common5,Files.Common6,Files.Common7
[SourceDisksNames]
1=,"Common1",,"C:\Users\akj\Documents\Udvikling\SVN\X\Trunk\Lib\"
2=,"Common2",,"C:\Users\akj\Documents\Udvikling\SVN\X\Trunk\Lib\"
3=,"Common3",,"C:\Users\akj\Documents\Udvikling\SVN\X\Trunk\Lib\"
4=,"Common4",,"C:\Users\akj\Documents\Udvikling\SVN\X\Trunk\Lib\"
5=,"Common5",,"C:\Users\akj\Documents\Udvikling\SVN\X\Trunk\Lib\"
6=,"Common6",,"C:\Users\akj\Documents\Udvikling\SVN\X\Trunk\Lib\"
7=,"Common7",,"C:\Users\akj\Documents\Udvikling\SVN\X\Trunk\ShoePDA2\obj\Release\"
[SourceDisksFiles]
"OpenNETCF.Net.dll"=1
"OpenNETCF.Windows.Forms.dll"=2
"OpenNETCF.WindowsCE.dll"=3
"OpenNETCF.dll"=4
"datalogic.device2008.dll"=5
"datalogic.wireless2008.dll"=6
"X.exe"=7
[DestinationDirs]
Shortcuts=0,%CE2%\Start Menu
Files.Common1=0,"Backup\XClient"
Files.Common2=0,"Backup\XClient"
Files.Common3=0,"Backup\XClient"
Files.Common4=0,"Backup\XClient"
Files.Common5=0,"Backup\XClient"
Files.Common6=0,"Backup\XClient"
Files.Common7=0,"Backup\XClient"
[Files.Common1]
"OpenNETCF.Net.dll","OpenNETCF.Net.dll",,0
[Files.Common2]
"OpenNETCF.Windows.Forms.dll","OpenNETCF.Windows.Forms.dll",,0
[Files.Common3]
"OpenNETCF.WindowsCE.dll","OpenNETCF.WindowsCE.dll",,0
[Files.Common4]
"OpenNETCF.dll","OpenNETCF.dll",,0
[Files.Common5]
"datalogic.device2008.dll","datalogic.device2008.dll",,0
[Files.Common6]
"datalogic.wireless2008.dll","datalogic.wireless2008.dll",,0
[Files.Common7]
"X.exe","X.exe",,0
[Shortcuts]
[RegKeys]
非常感谢您的帮助!
答案 0 :(得分:0)
这是一个非常奇怪的错误。我通过更新我使用该设备的API DLL解决了这个问题。当调试时没有发生错误时非常糟糕。哦,好吧,猜猜它已经解决了。