方法:
1:用記事本開啟對應csproj檔案,把裡面的" <SignManifests>true</SignManifests> "改成"<SignManifests>false</SignManifests>".
2:用記事本開啟項目的.csproj檔案,刪除類似以下xml就能順利通過編譯了
<ManifestCertificateThumbprint>B531F2CF222748C5E29308FC2247704827D1EA8C</ManifestCertificateThumbprint>
<ManifestKeyFile>xxxx_TemporaryKey.pfx</ManifestKeyFile>
<GenerateManifests>true</GenerateManifests>
<SignManifests>true</SignManifests>
<PublishUrl>D:\xxx\bin\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<CreateWebPageOnPublish>false</CreateWebPageOnPublish>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<BootstrapperEnabled>true</BootstrapperEnabled>
3.在“方案總管”中的項目上點右鍵- 〉屬性 -〉簽名 -〉把“為Clickonce清單簽名”前面的勾去掉,然後重建解決方案即可。
註:方法2沒做測試,方法1和3測試成功。