TFS 2010: Using Custom process parameter
-
Friday, August 13, 2010 3:13 PM
Hi,
I am new to Team Foundation Server and was going through Jason Prickett's blog of creating custom process parameters for workflow templates ( http://blogs.msdn.com/b/jpricket/archive/2010/01/18/tfs-2010-custom-process-parameters-part-4-custom-types.aspx )
The template after checked in, when used to create a new build, everything works fine. I even get my custom UI to populate the parameter as required. However on saving and queuing the build, the build fails with the following error:
TF215097: An error occurred while initializing a build for build definition <Build Definition Name>: The type ‘InArgument(c:VersionInfo)’ of property ‘VersionNumber’ could not be resolved.
Can any one explain me what the error is and what should I do to resolve this.
--
Thanks
All Replies
-
Tuesday, August 17, 2010 9:53 AMModerator
Hi NShah1215
Thanks for your post.
I’m doing some research and will give you a reply as soon as I get something.
Where is your assembly file? Does your TFS server can load it?
Please post some details.
Best regards,
Jason Xu
Please remember to mark the replies as answers if they help and unmark them if they provide no help. -
Tuesday, August 17, 2010 3:57 PM
Thanks Jason for the reply.
Here are the details:
After building the assembly file, I had copied it to the following directory:
Attempt 1:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies [Here I had only copied the assembly]
Attempt 2:
Along with the location in attempt 1, I had also register the assembly into GAC and then the assembly was available at following location as well:
C:\Windows\Microsoft.Net\assembly\GAC_MSIL [Here it appeared as a folder with a subfolder [v4.0_1.0.0.0__d7ec2369d013423b] which had the assembly.
I am not sure what you mean by "Does the TFS server load it". But if I try to create a new build definition using the checked in template that refers to this custom assembly, it allows me to set all the properties (opens up the custom editor as expected). I can even save and modify this values.
Only problem is as soon as I schedule the build, it fails with the mentioned error.
Hope this information helps.
-
Wednesday, September 15, 2010 6:27 PM
I too am having the same issue as NShan1215. I was following the instructions provided by Ewald Hofman in his blog post (http://www.ewaldhofman.nl/post/2010/05/17/Customize-Team-Build-2010-e28093-Part-6-Use-custom-type-for-an-argument.aspx). Everything works perfectly until a queued build starts. When the build process starts I receive the error:
TF215097: An error occurred while initializing a build for build definition \<projectname>\<buildprocessname>: The type ‘InArgument(vac:<customtypename>)’ of property ‘<argumentname>’ could not be resolved.
Any resolution to this problem. I am glad to say I am not the only one who encountered this issue, but sorry to say I have the same problem as NShan1215.
Has this been resolved?
Thanks
- Edited by Brett Ridenour Thursday, September 16, 2010 3:03 PM Additional Info
-
Thursday, November 18, 2010 4:51 AMI'm getting exactly the same error, when using a custom type as the type of an Argument. The XAML namespacing is correct, and the build agent has the correct assembly in its path, but it still errors. Any thoughts on how to debug this one?
-
Wednesday, May 04, 2011 9:13 PM
I too am getting this error. I followed the instructions in Ewald's post, checked my custom assembly into TFS, and added the path of that assembly to the build controller. I can edit my custom type in the build definition editor just fine (my custom dialog comes up and saves properly). However, when I go to queue a build, it immediately gets the error:
TF215097: An error occurred while initializing a build for build definition \[project]\[builddefinition]: The type ‘InArgument(b:[customtype])’ of property ‘[propertyname]’ could not be resolved.
The only thing that may be peculiar about my situation is that I used the LabDefaultTemplate.xaml as the starting point for customizing my build.
Has anyone resolved this?
-
Wednesday, May 18, 2011 1:44 PM
Still not resolved. I've tried various things, including rebooting my build controller server etc. Nothing seems to sort this. Anyone managed to resolve this?
Thanks
-
Tuesday, December 20, 2011 2:43 PM
I did experience the same error a few minutes ago, with an assembly containing only helpers and custom Types referenced by the assembly containing my actual custom activities ... The reason is really stupid IMO:
First, notice that if you work directly on the server, when you build a new assembly you have to close and reopen Visual Studio 2010 to allow TFS to reference the new assembly (I found this on Ewald Holfman blog).
Next, and this is the most important, you have to add at least one (possibly dummy) CodeActivity in all the assemblies to be loaded by TFS (ex.: in order to find your types).
Finally, never forget to refresh the template in the Build Definition. It can help also if you changed any type used by arguments (In the process tab, there is a Refresh button that will reload the build definition and the process template and synchronize them).
In my Case, I did add a class DummyCodeActivity.cs with
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.TeamFoundation.Build.Client; using System.Activities; namespace AG.SCRM.TeamBuild.Helpers { //If a custom assembly uses a dependent assembly (reference) which is needed to run activities, //they will not get deployed properly. If this is the case you will get “unknown type” errors on //build definition initialization: // TF215097: An error occurred while initializing a build for build definition xxxx: // The type ‘xxxx’ of property ‘xxxx’ could not be resolved. //To work around this issue, we add a dummy CodeActivity into the dependent assembly with the //class scoped attribute: [BuildActivity(HostEnvironmentOption.All)] [BuildActivity(HostEnvironmentOption.All)] public sealed class DummyCodeActivity : CodeActivity { protected override void Execute(CodeActivityContext context) { throw new NotImplementedException(); } } }
Valéry Letroye- Edited by Valéry Letroye Tuesday, December 20, 2011 2:50 PM
- Proposed As Answer by Valéry Letroye Friday, May 11, 2012 11:12 AM
-
Friday, May 11, 2012 11:12 AM
Jelle Druyts (http://jelle.druyts.net/) suggested me another solution to this know issue. It's a very interesting one as it also applies with third party assemblies (I.e.: assemblies in which you cannot add a Dummy Activity)
You can check a file into the custom assemblies path called CustomActivitiesAndExtensions.xml that looks like this:
<?xml version="1.0" encoding="utf-8"?> <Assemblies> <Assembly FileName="MyCustom.Core.dll"> <Extensions> <Extension FullName="MyCustom.Core.MyClass" /> </Extensions> </Assembly> </Assemblies>
The class name listed in the FulName attribute of the Extension element can be any class within the assembly that is public and has a parameter-less public constructor. This class will be constructed and loaded into memory so I’d recommend choosing a type whose constructor does as little as possible and has as few dependencies as possible (I typically look for Exception classes, data transfer objects, and the like).
This will force the assemblies listed to be downloaded and loaded into the workflow host so they’re available to your workflow and custom assemblies.
Valéry Letroye
- Proposed As Answer by Valéry Letroye Friday, May 11, 2012 11:12 AM
-
Wednesday, May 23, 2012 2:47 PMThe only way I could get this to work was to pass back a string object, then parse the string for the objects I was after. Never managed to get it working. Not tried since installing TSF2010 SP1, that might've fixed it.

