“Manifest XML signature is not valid” on client machine but works fine on developer computer

前端 未结 3 1045
天命终不由人
天命终不由人 2020-12-13 14:27

At work we had a ClickOnce application that, when the client would try to install, was throwing the exception:

  • Exception reading manifest f

3条回答
  •  -上瘾入骨i
    2020-12-13 15:04

    Update: This is fixed as of Visual Studio 2013 Update 3. Try publishing your app from that version of VS or later.

    Previous answer:

    It's because your developer machine had .NET 4.5 installed, while your client machines only had .NET 4.0 installed. The .NET 4.0 client machines can't read the manifest, as they expect SHA-1, while the .NET 4.5 developer machines can.

    See this blog post for some additional context.

    This change is due to the fact that we stopped using legacy certificates as default (SHA-1) in NetFX4.5 to sign manifest and instead, use newer version (SHA-256), which is not recognized by NetFx4.0 runtime. Therefore, while parsing the manifest, 4.0 runtime complains of an invalid manifest. For legacy frameworks, when we try to run a ClickOnce app on a box that does not have targeted runtime, ClickOnce pops up a message to user saying “you need xxxx.xx runtime to run this app”. But starting .NET 4.5, if a 4.5 ClickOnce app is run on the box with only .NET 4.0 installed, the message complains about an invalid manifest. In order to resolve the issue, you must install .Net Framework 4.5 on the target system.

    Try signing your manifest with a SHA-1 certificate instead of a SHA-2 certificate.

提交回复
热议问题