MSBuild错误MSB4018" SignTask"任务意外失败。在VS2015

时间:2016-03-25 16:27:54

标签: msbuild visual-studio-2015

编译新项目时,会出现以下错误:

Severity    Code    Description Project File    Line    Suppression State
Error   MSB4018 The "SignTask" task failed unexpectedly.
System.Security.Cryptography.CryptographicException: Acesso negado.

   at Microsoft.DriverKit.Build.Shared.CreateCertificate.CryptAcquireContext(String keyContainerName, String providerName, PROV providerType)
   at Microsoft.DriverKit.Build.Shared.CreateCertificate.CreateSelfSignedCertificate()
   at Microsoft.DriverKit.Build.Tasks.SignTask.AutoGenerateTestCertificate()
   at Microsoft.DriverKit.Build.Tasks.SignTask.AutoPickTestCertificate()
   at Microsoft.DriverKit.Build.Tasks.SignTask.GenerateCommandLineCommands()
   at Microsoft.Build.Utilities.ToolTask.Execute()
   at Microsoft.DriverKit.Build.Tasks.TrackedVCToolTask.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() BrunoGysinDriver    C:\Program Files (x86)\Windows Kits\10\build\WindowsDriver.common.targets   1348    

我试了好几次但没有找到

任何人都知道解决方案吗?

1 个答案:

答案 0 :(得分:1)

有效!我遇到了同样的问题,在管理员模式下运行可以正常工作!