PublicKey token warning building NET Core 5.0 Installer Project?

Philip Borchert 1 Reputation point
2021-10-08T14:31:26.887+00:00

I am receiving a warning when building the installer(Microsoft Visual Studio Installer Projects) project that the windowsdesktop-runtime-5.0.10-win-x64.exe does not match the public key. I downloaded the file right from fwlink The hyperlink doesn't appear to work. The link address is https://go.microsoft.com/fwlink/?linkid=2170729

I believe the problem is the product.xml file does not contain the public key for the file. That file contains the following:

  <!-- Defines list of files to be copied on build -->
  <PackageFiles CopyAllPackageFiles="false">
    <PackageFile Name="windowsdesktop-runtime-5.0.10-win-x64.exe"
                 HomeSite="https://go.microsoft.com/fwlink/?linkid=2170729"
                 **PublicKey="0"** />
    <PackageFile Name="NetCoreCheck.exe" />
  </PackageFiles>

To work around this I tried to find "Bootstrap Manifest Generator" on the Microsoft site but failed. I did find a download on softpedia. With this program I followed the second post in the following forum question: bootstrapper-public-key-for-net-45-runtime-doesnt-match This is a workaround that removed the error but I think this needs fixed by a Microsoft Update. Why is the public key in the product.xml file 0?

Steps to create the issue.

  1. File->New->Project->C# WPF Application
  2. Project Name->I used "Error"
  3. Target Framework->.NET 5.0 (Current)
  4. Add a TextBlock to the form, Change the text to Hello World
  5. Build->Configuration Manager
  6. Under Active Solution Platform-Drop Down Combo Box choose <New...>
  7. Change Type or Select the new platform combo box to X64, Click Ok
  8. Change Active Solution Configuration to -- Release
  9. Close
  10. Build Error
  11. Right Click Error Project and choose Publish
  12. Choose Folder
  13. Next Choose Folder again
  14. Click Finish (my folder location was "bin\Release\net5.0-windows\publish\"
  15. Close the Publish Tab
  16. Right Click Solution Error in the Solution Explorer
  17. Add->New Project
  18. Choose "Setup Project"
  19. Rename Project Name Setup
  20. Click Create
  21. On The installer project -> Right Click -> Choose File System
  22. Right Click Application Folder
  23. Choose Add Project Output
  24. Choose Publish Items
  25. Change Configuration to Release X64
  26. Click Ok
  27. Navigate to (C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VisualStudio\BootstrapperPackages\net5desktopruntime_x64) or similar folder ((This took me awhile to find I ended up using SysInternals ProcMon and finding where it was trying to find the file)) YEMV
  28. Inside this folder you should see various cultural folders NetCoreCheck.exe and product.xml
  29. In my case the "windowsdesktop-runtime-5.0.10-win-x64.exe" file was not there yet.
  30. Open in Notepad++ or something product.xml
  31. There are two things you will want to do.
  32. First toward the top of the file Notice that PublicKey="0"
  33. Copy the URL from the HomeSite attribute mine is "https://go.microsoft.com/fwlink/?linkid=2173715"
  34. Paste this URL into a browser (I used Chrome, I assume Edge will do the same) and it will download a file, most likely placing it into the Downloads folder.
  35. Open Your downloads folder in a new explorer window and copy or cut the file and place it in the "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VisualStudio\BootstrapperPackages\net5desktopruntime_x64" Folder.
  36. Back to Visual Studio
  37. Click on Setup and look at the Properties Tab, Set the TargetPlatform to X64
  38. Right Click on Setup and Choose Properties
  39. Click the "Prerequisites..." Button
  40. Click the checkbox next to ".Net Desktop Runtime 5.0.11 (x64)"
  41. Choose the "Download prerequisites from the same location as my application" radio button
  42. Click Ok to exit the prerequisites dialog, click apply on the "Setup Property Pages", then click ok on the "Setup Property Pages"
  43. Now attempt to build the setup project and you will receive an error "ERROR: To enable 'Download prerequisites from the same location as my application' in the Prerequisites dialog box, you must download file 'net5desktopruntime_x64\windowsdesktop-runtime-5.0.11-win-x64.exe' for item '.NET Desktop Runtime 5.0.11 (x64)' to your local machine. For more information, see http://go.microsoft.com/fwlink/?LinkId=616018."
  44. To fix this you must modify the product.xml file from step 30 fix the missing PublicKey
  45. This is the PublicKey "3082010A0282010100B6BB19591000A3A9F1E4B85CA80B07CBDB9A1F23D0D958AB78C048F7241438F063EDD54B03BFCDF809CA1450F327B3FE82B4FA1A4384E1CBF91B38E83FCC9027AC97A2310A917B62EC75BFCD488DA05D75FD95A775FF23D40CE5E8E063703E35EAD49662F87655F756D4AFA663CDE3E3D60F9B7A9B2A77F1C2D5749C8F47D3DDA0312D1CA4252CC4C4406653D792CAE3B052EABE0AB8AE750B5618C74953AE74BFF2A6CDF338E98EA5A3F3029E7A6FCF7CC42FB3CC754770AA3FE7621186DD45482F15FBB4074C6F3ECB37EE96388A53D40E35AF06A83959EFFBC51AF781F0863666BB54BBDF2795ED1659371A2111E8098BD618B2C5DAED465452408203E2A70203010001"
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,643 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,141 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,767 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Philip Borchert 1 Reputation point
    2021-11-08T12:46:45.843+00:00

    Hi @PengGe-MSFT

    It looks like the fix will be in the next release. I tried to put it in as an answer and link the other thread: https://developercommunity.visualstudio.com/t/publickey-token-warning-building-net-core-50-insta/1563816?from=email

    It would not let me. Kept saying Azure issue.