title: TF215097 Custom Build Activities using Com Interop on 64 bitsTF215097: An error occurred w
body: <p>TF215097: An error occurred while initializing a build for build definition {DefinitionName}: The invocation of the constructor on type 'Classname' that matches the specified binding constraints threw an exception.</p>
  
  <p>OK some had already answered this very well:
  <a href="https://stackoverflow.com/questions/2910983/tfs-2010-custom-build-activity-tf215097-error">TFS 2010 Custom Build Activity TF215097 error</a></p>
  
  <p>I had the same issue before and corrected them by adding the correct attribute:
  Microsoft.TeamFoundation.Build.Client.BuildActivity( Microsoft.TeamFoundation.Build.Client.HostEnvironmentOption.Agent )</p>
  
  <p>My build is running well on x86 machine but give the error on 64 bit build controller or agent.</p>
  
  <p>The Context :</p>
  
  <p>I created several Build Activities. One of this activity is a Visual Build Pro runner activity. I referenced the Visual Build Professional 6 Server Object. (We have several project and could not update it... at this point)
  When I build the assembly VS 2010 generate Native.{MyAssemblyName}.manifest </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;assembly xsi:schemaLocation="urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd" manifestVersion="1.0" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#" xmlns:co.v1="urn:schemas-microsoft-com:clickonce.v1" xmlns:co.v2="urn:schemas-microsoft-com:clickonce.v2" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
    &lt;assemblyIdentity name="Native.EMI.TeamFoundation.Build" version="1.0.0.0" type="win32" /&gt;
    &lt;file name="VisBuildSvr.dll" asmv2:size="712904"&gt;
      &lt;hash xmlns="urn:schemas-microsoft-com:asm.v2"&gt;
        &lt;dsig:Transforms&gt;
          &lt;dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" /&gt;
        &lt;/dsig:Transforms&gt;
        &lt;dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /&gt;
        &lt;dsig:DigestValue&gt;aePKKx7BgE7vN7OjQqwrQ2bvex8=&lt;/dsig:DigestValue&gt;
      &lt;/hash&gt;
      &lt;typelib tlbid="{c48285d5-e97e-4824-9e14-faf8124b00a4}" version="1.0" helpdir="C:\Program Files (x86)\VisBuildPro6\System\VisBuildPro.chm" resourceid="0" flags="HASDISKIMAGE" /&gt;
      &lt;comClass clsid="{d87ad38d-99d9-4e04-9505-696c3afde66c}" threadingModel="Both" tlbid="{c48285d5-e97e-4824-9e14-faf8124b00a4}" progid="VisBuildSvr6.Application" description="Visual Build Pro 6 server application component" /&gt;
      &lt;comClass clsid="{1cc058ff-793f-4560-9fad-48d88db93ca9}" threadingModel="Free" tlbid="{c48285d5-e97e-4824-9e14-faf8124b00a4}" progid="VisBuildSvr6.Builder" description="Visual Build core builder component (MTA)" /&gt;
      &lt;comClass clsid="{5ef3f30b-278b-4796-8f23-41fdd5ddc96c}" threadingModel="Both" tlbid="{c48285d5-e97e-4824-9e14-faf8124b00a4}" progid="VisBuildSvr6.BuilderSTA" description="Visual Build core builder component (MTA/STA)" /&gt;
    &lt;/file&gt;
  &lt;/assembly&gt;
  </code></pre>
  
  <p>And Interop.VisBuildSvr.dll assembly</p>
  
  <p>When I trig a build on a Windows 64 bit Build Controller and Agent on the same machine I have the TF error. 
  I tried to attach the debugger on the controller and I am able to see the first error :</p>
  
  <pre><code>A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll
  
  Additional information: Could not load file or assembly 'Interop.VisBuildSvr, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d64ea679b6fd0408' or one of its dependencies. The system cannot find the file specified.
  </code></pre>
  
  <p>That file is on my custom assemblies folder on TFS and also on the BuildController and BuildAgent folder. </p>
  
  <p>Thanks </p>