error MSB4018 in vs2017: The “SignFile” task failed unexpectedly

拈花ヽ惹草 提交于 2021-02-05 08:10:48

问题


I have a ppt2013 plugin solution with vsto, developer machines with vs 2017 installed.When I build, it comes the signFile error. I've installed

.Net framework 4.5.1 targeting pack
.Net framework 4.5.1 SDK
.Net framework 4.5.2 targeting pack
.Net framework 4.6 SDK
.Net framework 4.6 targeting pack
.Net framework 4.6.1 targeting pack
.Net framework 4.6.2 SDK
.Net framework 4.6.2 targeting pack

Does anyone have a good idea to solve the error?

> detail: D:\Program Files (x86)\Microsoft Visual
> Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(264,9):
> error MSB4018: The "SignFile" task failed unexpectedly. 8>D:\Program
> Files (x86)\Microsoft Visual
> Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(264,9):
> error MSB4018: System.InvalidOperationException: Exception of type
> 'System.InvalidOperationException' was thrown. 8>D:\Program Files
> (x86)\Microsoft Visual
> Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(264,9):
> error MSB4018:    at
> Microsoft.Build.Tasks.Deployment.ManifestUtilities.SecurityUtilities.SignFileInternal(X509Certificate2
> cert, Uri timestampUrl, String path, Boolean
> targetFrameworkSupportsSha256, ResourceManager resources) 8>D:\Program
> Files (x86)\Microsoft Visual
> Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(264,9):
> error MSB4018:    at
> Microsoft.Build.Tasks.Deployment.ManifestUtilities.SecurityUtilities.SignFile(String
> certThumbprint, Uri timestampUrl, String path, String
> targetFrameworkVersion) 8>D:\Program Files (x86)\Microsoft Visual
> Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(264,9):
> error MSB4018:    at Microsoft.Build.Tasks.SignFile.Execute()
> 8>D:\Program Files (x86)\Microsoft Visual
> Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(264,9):
> error MSB4018:    at
> Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
> 8>D:\Program Files (x86)\Microsoft Visual
> Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(264,9):
> error MSB4018:    at
> Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()

回答1:


I have resolved this issue.The SignFile is not installed correctly.enter image description here

Double Click SignFile directly to install leads to the issue.Select File in the Project followed the png's guid is right.




回答2:


What framework does your project target? It seems to be similar issue described here.

Please make sure you've installed the corresponding target-framework SDK, also you may need to install the .Net 4.0 SDK and restart PC to build the project again.

In addition: It seems you haven't install .net 4.6.1 SDK, so if possible you may need to install the .net framework 4.6.1 SDK also. Go Tools=>Get Tools and Features=>Individual Components to install the .net framework 4.6.1 SDK package.



来源:https://stackoverflow.com/questions/58296668/error-msb4018-in-vs2017-the-signfile-task-failed-unexpectedly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!