我进行了Windows 10和Visual Studio 2015的全新安装,但无法找到makecert.exe文件。是否需要安装其他软件来获取该程序?
我查看了“C:\Program Files (x86)\Microsoft SDKs\Windows\\"下的所有文件夹,但没有找到它。
我还打开了“VS2015开发人员命令提示符”并尝试运行“makecert”,但未找到该文件。
我进行了Windows 10和Visual Studio 2015的全新安装,但无法找到makecert.exe文件。是否需要安装其他软件来获取该程序?
我查看了“C:\Program Files (x86)\Microsoft SDKs\Windows\\"下的所有文件夹,但没有找到它。
我还打开了“VS2015开发人员命令提示符”并尝试运行“makecert”,但未找到该文件。
如ShaneH在这个问题中所回答的,makecert.exe
已经被弃用了,我们应该使用PowerShell命令let New-SelfSignedCertificate。
New-SelfSignedCertificate -Subject "CN=测试代码签名" -Type CodeSigningCert -KeySpec "Signature" -KeyUsage "DigitalSignature" -FriendlyName "测试代码签名" -NotAfter (get-date).AddYears(5)
对于旧版本的PS,可以从TechNet获取此脚本: https://gallery.technet.microsoft.com/scriptcenter/Self-signed-certificate-5920a7c6
为了让我的回答更加完整,以下是如何使用TechNet脚本的简要说明:
.\New-SelfsignedCertificateEx -Subject "CN=测试代码签名" -EKU "Code Signing" -KeySpec "Signature" -KeyUsage "DigitalSignature" -FriendlyName "测试代码签名" -NotAfter [datetime]::now.AddYears(5)
如果你在使用这个工具时遇到问题,还有两点需要注意。
Set-ExecutionPolicy unrestricted
.\
(点斜杠),因为这是必要的。.\New-SelfsignedCertificateEx
命令时,我无法使其正常工作(没有错误,也没有证书),直到我运行了 Import-Module .\New-SelfSignedCertificateEx.ps1
。之后,我就可以使用 New-SelfsignedCertificateEx
命令(不需要前面的“.\”),脚本就可以正常工作了。 - sherbWindows Powershell
-> 2. 运行 Set-ExecutionPolicy unrestricted
-> 3. 运行 New-SelfSignedCertificate -Subject "CN=Test Code Signing" -Type CodeSigningCert -KeySpec "Signature" -KeyUsage "DigitalSignature" -FriendlyName "Test Code Signing" -NotAfter (get-date).AddYears(5)
。 - Minh NguyenC:\Program Files (x86)\Fiddler2
文件夹中。这比完整的Windows SDK要下载的内容要小得多。