gpt4 book ai didi

c# - Windows 服务 serviceCredentials 无效的十六进制字符串格式

转载 作者:太空狗 更新时间:2023-10-29 20:51:17 24 4
gpt4 key购买 nike

我正在调试 Win 服务。我在服务器上添加了一些证书。试图通过序列号查找证书。 https://gyazo.com/9cdcda75e98fe7b7c35496976a5aaaeb

behaviors.config 部分:

  <serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="DDBS.DDBSPasswordValidator, DDBS" />
<serviceCertificate findValue="‎1C5411F9D38252824C2EC1CC7E5EBE3F" x509FindType="FindBySerialNumber" storeLocation="LocalMachine" storeName="My" />
</serviceCredentials>

我收到错误:无法启动服务。 System.FormatException:无效的十六进制字符串格式。

最佳答案

来自 Jan Angelovič 于 MSDN Forum :

If you cut and paste the [Serial Number or Thumbprint] from the common certificate dialog, it is copied in UNICODE (UTF-16LE) encoding with special invisible control characters (0xFF and 0xFE aka “Byte order mark“) on the beginning of the string.

就个人而言,我通过指纹看到了这一点;从对话框剪切并粘贴到 Visual Studio 中保留了 2 个未显示的字符(可以用光标“逐步执行”并删除)。

关于c# - Windows 服务 serviceCredentials 无效的十六进制字符串格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34462702/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com