尽管导入了证书,但由于MSBuild ResolveKeySource错误而导致CruiseControl.NET服务无法构建 [英] CruiseControl.NET service failing to build due to MSBuild ResolveKeySource error, despite certificate being imported

查看:255
本文介绍了尽管导入了证书,但由于MSBuild ResolveKeySource错误而导致CruiseControl.NET服务无法构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们刚刚将一个XBAP/WBA项目添加到了我们的构建服务器.它使用PFX文件进行签名.我将PFX文件导入到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:"ResolveKeySource"任务意外失败. System.InvalidOperationException:当应用程序不在UserInteractive模式下运行时,显示模式对话框或窗体不是有效操作.指定ServiceNotification或DefaultDesktopOnly样式以显示来自服务应用程序的通知.在System.Windows.Forms.Form.ShowDialog(IWin32Window所有者)

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.

有人看到过这种行为还是可以推荐另一种方法?我知道我可以以用户身份运行CruiseControl.NET(解决方案是从命令行编译的),但由于所有权限都是针对服务帐户配置的,因此希望避免,因为它可能更希望作为服务运行.

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.

推荐答案

感谢 Preet 的建议,我可以使用以下过程使其工作:

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

  1. 为CruiseControl.NET服务创建了一个用户.
  2. 授予用户登录为服务权限的权限,并将CruiseControl.NET服务更改为以该用户身份运行.
  3. 以该用户身份登录,并从命令行运行XBAP项目.
  4. 在ResoveKeySource任务提示时输入PFX密码.
  5. CruiseControl.NET中经过测试的建筑物,绿灯亮,棒极了!

有趣的是,作为第3步的一部分,以该用户身份登录后,在从命令行运行MSBuild之前,我将PFX文件导入到其证书存储中.这不是解决问题的方法,我不得不从命令行构建项目,输入密码,然后通过CruiseControl.NET服务运行.

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.

谢谢你!

这篇关于尽管导入了证书,但由于MSBuild ResolveKeySource错误而导致CruiseControl.NET服务无法构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆