问题
I have the following problem when deploying the project:
Warning 8 The value of the 'PublicKey' attribute in 'Microsoft Report Viewer 2012 Runtime' does not match that of file 'C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages\ReportViewer\ReportViewer.msi'.
It is the same for the other components:
Warning 6 The value of the 'PublicKey' attribute in 'Microsoft® System CLR Types for SQL Server® 2012 (x86)' does not match that of file 'C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages\SqlClrTypes_x86\SQLSysClrTypes.msi'.
This warning can not be ignored since it creates problem when installing the software on the other device.
回答1:
Visual Studio checks a file called Product.xml
for details about installer prerequisites. This file will be in the same location as the installer cited in the warning.
For each warning you need to update the PackageFile
property PublicKey
to match the installer you are using. As new versions come out, the signature might change but the Product.xml
is not included with new installer version and thus it doesn't always match.
To resolve this issue:
Update the Package Data
- Open the
[Program Files]\Microsoft SDKs\Windows\$Version\Bootstrapper\Packages\$PackageName folder
- Right-Click the installer package cited.
- Select Properties
- Select
Digital Signatures
tab - Select
sha1
digest from the signature list - Click
Details
- Click
View Certificate
- Select
Details
tab - Select
Public Key
- Copy all the text from the preview window
- Paste it in to a text editor
- Use Find\Replace tool to remove all spaces from the key
- Edit the
Product.xml
file. - Find the element for
<PackageFile Name="$PackageName"
and change thePublicKey
- Save the
Product.xml
file. - Repeat for each package with this warning.
来源:https://stackoverflow.com/questions/17374809/publickey-issues-when-deploying-the-project