The Ramblings of Two Microsoft .NET Developers, TFS, and Visual Studio ALM Guys --- "Yes, we are both named Ed."

Team Build and Strong Naming or Click-Once



I woke up to a FAILED build report in my inbox this morning... Not the best of signs but it happens, right?

So I'm trying to figure out what in the world could have gone wrong.  What did we change since the last build that could have caused this madness?  OK, I know I'm being over-dramatic :-)

Here's what I had in the build report:

Target ResolveKeySource: 
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1718,7): error MSB4018: The "ResolveKeySource" task failed unexpectedly.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1718,7): error MSB4018: 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.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1718,7): error MSB4018: at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1718,7): error MSB4018: at System.Windows.Forms.Form.ShowDialog()
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1718,7): error MSB4018: at Microsoft.Build.Tasks.ResolveKeySource.ResolveManifestKey()
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1718,7): error MSB4018: at Microsoft.Build.Tasks.ResolveKeySource.Execute()
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets(1718,7): error MSB4018: at Microsoft.Build.BuildEngine.TaskEngine.ExecuteTask(ExecutionMode howToExecuteTask, Hashtable projectItemsAvailableToTask, BuildPropertyGroup projectPropertiesAvailableToTask, Boolean& taskClassWasFound)
Done building target "ResolveKeySource" in project "untimyrm.tmp_proj" -- FAILED.

I think I knew what happened... I had just set up the Click-Once settings in our app and I bet the build server doesn't have the key file we are using.  Sure enough, I happened to be write!  I found out this could also happen if you are signing your assemblies as well with a strong name.  MSDN Forums has the details.

Here's Nagaraju Palla's answer:

For password protected signing keys to work on build without prompting, they need to be exported into a key container crypto store on the build machine under the account that performs the build. Once exported, the build will not ask for a password anymore. The crypto store will do the signing and take care to keep private key safe.

One of the quicker ways to do this:

- Logon to the build machine using the build service account

- Run msbuild on any project that uses this signing key. It will prompt for the password and will export the key.

- Now start the TeamBuild full build.

Ed B.

Posted in TFS


Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, strike, strong, sub, sup, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

[Captcha]Enter the code shown (prevents robots):

Live Comment Preview