c# - 使用 MSBuild 发布 VSTO 加载项会出现错误 : The "SignFile" task failed unexpectedly. System.ArgumentNullException:值不能为空

标签 c# visual-studio-2013 msbuild vsto teamcity

我正在尝试在没有 Visual Studio 的 TeamCity 生成服务器上使用 MSBuild 为 Word 发布 VSTO 加载项。我已经完成了这两篇博客文章中的内容:

http://kentb.blogspot.com/2008/08/building-vsto-projects-without-visual.html http://www.wiktorzychla.com/2011/02/msb3147-could-not-find-required-file-on.html

我的构建文件是我的 Visual Studio 解决方案,我的目标是“发布”。在我的开发机器上,在 Visual Studio 2013 中的 ClickOnce 发布工作正常。

但是在构建服务器上,我得到了这个:

[SignFile] C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\OfficeTools\Microsoft.VisualStudio.Tools.Office.targets(612, 9): error MSB4018: The "SignFile" task failed unexpectedly. System.ArgumentNullException: Value cannot be null. Parameter name: path1 at System.IO.Path.Combine(String path1, String path2, String path3) at Microsoft.Build.Tasks.Deployment.ManifestUtilities.SecurityUtilities.GetPathToTool() at Microsoft.Build.Tasks.Deployment.ManifestUtilities.SecurityUtilities.SignPEFile(X509Certificate2 cert, Uri timestampUrl, String path, ResourceManager resources, Boolean useSha256) at Microsoft.Build.Tasks.Deployment.ManifestUtilities.SecurityUtilities.SignFile(X509Certificate2 cert, Uri timestampUrl, String path) at Microsoft.Build.Tasks.Deployment.ManifestUtilities.SecurityUtilities.SignFile(String certThumbprint, Uri timestampUrl, String path) at Microsoft.Build.Tasks.SignFile.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.d__20.MoveNext()

我不知道这意味着什么或如何解决它。有什么想法吗?

最佳答案

回答我自己的问题,因为这可能对将来的人有所帮助。

我发现这是因为该版本的 SignFile 任务需要我没有安装的 signtool.exe。我安装了 Windows SDK 并勾选了所有选项,它已安装并且我的发布任务现在可以运行了。我不确定它属于哪个选项,但我认为它不是 .NET 选项,因为我已经安装了它。

关于c# - 使用 MSBuild 发布 VSTO 加载项会出现错误 : The "SignFile" task failed unexpectedly. System.ArgumentNullException:值不能为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28283361/

相关文章:

c# - List<T> 连接 'X' 个列表数量

c# - 将逗号分隔的参数传递给 SQL 中的存储过程

vb.net - Visual Studio 2015 中是否有 Visual Basic 交互式窗口?

asp.net-web-api - 无法从程序集中加载 "TypeScript.Tasks.FindConfigFiles"任务

msbuild - 如何使用默认值初始化 ItemGroup 中的项目?

msbuild - 从命令行执行 msbuild : getting errors for the referenced namespace 'Microsoft.VisualStudio.TestTools'

c# - 尝试创建一个自定义 cmdlet,它将 [ref] 作为参数

c# - Workflow Foundation - 在自定义设计器中分配 InArgument

c++ - 为什么 OpenSSL 在 Windows 上无法正确链接

c++ - 如何在 Visual Studio 2013 中设置默认头文件扩展名?