尽管已导入证书,但由于 MSBuild ResolveKeySource 错误,CruiseControl.NET 服务仍无法构建

发布于 2024-08-07 23:28:23 字数 747 浏览 2 评论 0原文

我们刚刚将一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

地狱即天堂 2024-08-14 23:28:23

感谢 Preet 的建议,我能够使用以下过程让它工作:

  1. 为CruiseControl.NET 服务。
  2. 授予用户作为服务登录的权限,并将 CruiseControl.NET 服务更改为以该用户身份运行。
  3. 以该用户身份登录并从命令行运行 XBAP 项目。
  4. 当 ResoveKeySource 任务提示时输入 PFX 密码。
  5. 从 CruiseControl.NET 测试构建,绿灯亮了,天啊!

有趣的是,作为步骤 3 的一部分。以该用户身份登录后,我将 PFX 文件导入到其证书存储中,然后从命令行运行 MSBuild。这没有解决问题,我必须从命令行构建项目,输入密码,然后它可以从 CruiseControl.NET 服务运行。

谢谢普雷特!

Thanks to Preet's suggestion, I was able to get it working using the following process:

  1. Created a user for the CruiseControl.NET service.
  2. Gave user log on as a service rights and changed CruiseControl.NET service to run as this user.
  3. Logged on as this user and ran the XBAP project from the command line.
  4. Entered the PFX password when prompted by ResoveKeySource task.
  5. Tested building from CruiseControl.NET, green lights, horray!

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文