MSB3327

完整的錯誤文字類似下列範例:

MSB3327: Unable to find code signing certificate in the current user’s Windows certificate store. To correct this, either disable signing of the ClickOnce manifest or install the certificate into the certificate store.

如果您已啟用簽署 ClickOnce 資訊清單,而且當 MSBuild 嘗試發佈資訊清單時在憑證存放區中找不到針對 ClickOnce 資訊清單簽署指定的 .pfx 檔案,則可能會收到此錯誤。

若要解決此錯誤,請嘗試在憑證存放區中重新匯入 .pfx 檔案。 若要重新匯入 .pfx 檔案,請在 [Windows 檔案總管] 中以滑鼠右鍵按一下該 .pfx 檔案,然後選擇 [安裝 PFX]

Screenshot of signing tab

請參閱作法:簽署應用程式和部署資訊清單,若是在 Visual Studio 2019 或更新版本中的更新 .NET 專案,請參閱使用 ClickOnce 部署 .NET Windows 桌面應用程式

在非互動式環境中執行時 (例如管線中的指令碼),請使用命令列工具 certutil

certutil –f –p [certificate_password] –importpfx <path to pfx file>