title: Tridion: Error loading Assembly 'Tridion.ContentDelivery.Interop'
body: <p>We are converting VBScript templates to .net compound templates and are facing some issues while using Broker Query Mechanism.</p>
  
  <p>Our Old code looks like:</p>
  
  <pre><code>sQuery = "query" &amp; nNumber &amp;  ".AddCriteria(""schema"",""="", ""1132"");"&amp; vbcrlf
  if objFields.Item("FilterBD").Value.Count &gt;0 Then
       if objFields.Item("FilterBD").Value(1) = "Yes" Then
        sQuery = sQuery &amp; "query" &amp; nNumber &amp; ".AddOperator(Query.QueryOperator.AND_Field);"&amp; vbcrlf
           sQuery = sQuery &amp; "query" &amp; nNumber &amp; ".AddCriteria(""categorization"", ""="", ""Broker_Dealer/test"");" &amp; vbcrlf
       End If
  End If
  </code></pre>
  
  <p>While converting this to .net, we added a reference of Tridion.ContentDelivery.DynamicContent dll to our project, so that we can write our code (sample) as:</p>
  
  <pre><code>using Tridion.ContentDelivery.DynamicContent.Query;
  Tridion.ContentDelivery.DynamicContent.Query.Query query = new Tridion.ContentDelivery.DynamicContent.Query.Query();
  ItemSchemaCriteria isArticle = new ItemSchemaCriteria(1132);
  CategoryCriteria bdCategory = new CategoryCriteria("Broker_Dealer/\" + \"test\"");
  Criteria bdCriteria = CriteriaFactory.And(isArticle, bdCategory);
  query.Criteria = bdCriteria;
  </code></pre>
  
  <p>This approach is working well in Visual studio so far, but while Building our CT in template builder, we are getting the error "Could not load file or assembly 'Could not load file or assembly 'Tridion.ContentDelivery.Interop, Version=6.1.0.43, Culture=neutral, PublicKeyToken=ddfc895746e5ee6b' or one of its dependencies. The system cannot find the file specified.'</p>
  
  <p>After following <a href="http://sdllivecontent.sdl.com/LiveContent/web/pub.xql?action=home&amp;pub=SDL_Tridion_2011_SPONE&amp;lang=en-US#addHistory=true&amp;filename=MakingCustomCodeWorkWithNewCDAssemblies.xml&amp;docid=task_A3E701D765BB44A4AE3BFDA6A537DBFA&amp;inner_id=&amp;tid=&amp;query=&amp;scope=&amp;resource=&amp;eventType=lcContent.loadDoctask_A3E701D765BB44A4AE3BFDA6A537DBFA" rel="nofollow">these Steps of registering the dlls in GAC</a>,  we are still receiving the same problem?</p>
  
  <p>Anything we missed? Kindly help.
  Thanks.</p>