CruiseControl.NET service failing to build due to MSBuild ResolveKeySource error, despite certificate being imported

邮差的信 提交于 2019-12-21 20:27:47

问题


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.


回答1:


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!



来源:https://stackoverflow.com/questions/1587247/cruisecontrol-net-service-failing-to-build-due-to-msbuild-resolvekeysource-error

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