【问题标题】:Problems running the program on another machine在另一台机器上运行程序的问题
【发布时间】:2016-11-03 20:51:22
【问题描述】:

我在另一台机器上运行程序时遇到问题。它返回一个缺少某些 dll 的错误。这样所有的 DLL 都在程序文件夹中。我选择了所有依赖项并“始终复制”并创建了一个安装项目,但它仍然返回错误。

  Problem Event Name:   CLR20r3
  Problem Signature 01: program.exe
  Problem Signature 02: 1.0.1.0
  Problem Signature 03: 581b1c83
  Problem Signature 04: Program
  Problem Signature 05: 1.0.1.0
  Problem Signature 06: 581b1c83
  Problem Signature 07: c1
  Problem Signature 08: 5
  Problem Signature 09: System.DllNotFoundException
  OS Version:   6.1.7601.2.1.0.768.2
  Locale ID:    1033
  Additional Information 1: 0a9e
  Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
  Additional Information 3: 0a9e
  Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
  C:\Windows\system32\en-US\erofflps.txt

【问题讨论】:

    标签: c# dependencies


    【解决方案1】:

    确保您在项目中设置了CopyLocal=true

    Copy Local 属性确定是否将引用复制到本地 bin 路径。在运行时,引用必须存在于全局程序集缓存 (GAC) 或项目的输出路径中。如果此属性设置为 true,则在运行时将引用复制到项目的输出路径。

    您也可以参考这个解决方案。 How can I debug System.DllNotFoundException when missing DLL is not reported?

    【讨论】:

    • 嗨。您正在使用的某些 dll 是否有可能是需要注册的 COM dll?或者它们可能是需要在 GAC 中的 .NET 程序集?项目是用anycpu、x86还是x64编译的,dll也是如此?
    猜你喜欢
    • 2019-10-26
    • 2018-04-21
    • 1970-01-01
    • 2014-01-21
    • 2012-04-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多