What could be causing a System.TypeLoadException?

后端 未结 8 1267
轮回少年
轮回少年 2020-11-27 20:39

I\'m developing, with VS2008 using C#, an application for Honeywell Dolphin 6100, a mobile computer with a barcode scanner that uses Windows CE 5.0 like OS.

I want to

相关标签:
8条回答
  • 2020-11-27 21:40

    It could be any number of things. Likely causes are:

    • The assembly cannot be found
    • An assembly that your assembly depends upon cannot be found
    • The assembly is found but the type isn't in it
    • The type's static constructor throws an exception

    Your best bet is to use the Fusion log viewer to help diagnose it. Documentation is here:

    http://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.110).aspx

    (FYI "Fusion" was the code name of the team that designed the assembly loading system; it is somewhat unfortunate that the code name ended up in the file name of the shipped product. The thing should have been called "AssemblyBindingLogViewer.exe" or some such thing.)

    0 讨论(0)
  • 2020-11-27 21:42

    In my case problem was that I had two projects that used the same libraries in one solution. I've updated DLLs only in first project. So when I built solution, second project its override DLLs from first project(project build order).

    Example:

    Solution:

    --MainProject

    ------MyDll v5.3.2.0

    --Prototype

    ------MyDll v5.0.0.0

    Problem gone after update DLLs in second project.

    0 讨论(0)
提交回复
热议问题