尽管已导入证书,但由于 MSBuild ResolveKeySource 错误,CruiseControl.NET 服务仍无法构建
我们刚刚将一个 XBAP/WBA 项目添加到我们的构建服务器中。它使用 PFX 文件进行签名。我将 PFX 文件导入到 CruiseControl.NET 服务证书存储中,并且可以在该服务的证书存储中看到它。然而,我们仍然看到 ResoveKeySource 抛出异常:
c:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets (1805,7): errorMSB4018: “ResolveKeySource”任务意外失败。 System.InvalidOperationException:当应用程序未在 UserInteractive 模式下运行时显示模式对话框或表单不是有效操作。指定 ServiceNotification 或 DefaultDesktopOnly 样式以显示来自服务应用程序的通知。在 System.Windows.Forms.Form.ShowDialog(IWin32Window 所有者)
我还启用了(希望不仅仅是知识)该服务与桌面交互。
有没有人见过这种行为或者可以推荐另一种方法?我知道我可以以用户身份运行 CruiseControl.NET(解决方案是从命令行编译),但希望尽可能避免,因为所有权限都是针对服务帐户配置的,并且更喜欢作为服务运行。
We just had an XBAP/WBA project added to our build server. It uses a PFX file for signing. I imported the PFX file to the CruiseControl.NET service certificate store, and can see it in the certificate store for the service. Yet we are still seeing an exception thrown by ResoveKeySource:
c:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets (1805,7): errorMSB4018: The "ResolveKeySource" task failed unexpectedly. System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application. at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
I also enabled (in hope more than knowledge) the service to interact with the desktop.
Has anyone seen this behaviour or can recommend another approach? I know I can run CruiseControl.NET as a user (the solution is compiling from command line), but would like to avoid if possible since all the permissions are configured against the service account, and would prefer running as a service.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
感谢 Preet 的建议,我能够使用以下过程让它工作:
有趣的是,作为步骤 3 的一部分。以该用户身份登录后,我将 PFX 文件导入到其证书存储中,然后从命令行运行 MSBuild。这没有解决问题,我必须从命令行构建项目,输入密码,然后它可以从 CruiseControl.NET 服务运行。
谢谢普雷特!
Thanks to Preet's suggestion, I was able to get it working using the following process:
What is interesting is that as part of step 3. After logging on as this user, I imported the PFX file into it's certificate store before running MSBuild from command line. This didn't solve the problem, I had to build the project from the command line, enter the password and then it worked from CruiseControl.NET service.
Thank you Preet!