title: Structuremap syntax in version 2.5.4
body: <p>I have just updated to the latest structuremap dll and now my site no longer works at runtime due to deprecated methods in structuremap so I am trying to update my bootstrapper code.</p>
  
  <p>In my bootstrapper class I have rewritten it to:</p>
  
  <pre><code>public class Bootstrapper
  {
      public static void ConfigureStructureMap()
      {
          ObjectFactory.Initialize(InitializeStructureMap);
      }
  
      private static void InitializeStructureMap(IInitializationExpression x)
      {
          x.AddRegistry(new DatabaseServiceRegistry());                        
          x.For&lt;IArticleService&gt;().Use&lt;ArticleService&gt;();
          x.For&lt;IArticleRepository&gt;().Use&lt;SqlArticleRepository&gt;();
      } 
  }
  </code></pre>
  
  <p>I have added the registry line as I am using Linq to SQL which is in a seperate project.</p>
  
  <p>This is the code that worked in the older version of StructureMap:</p>
  
  <pre><code>public class DatabaseServiceRegistry : Registry
  {
      public override void ConfigureStructureMap()
      {
          ForRequestedType&lt;Database&gt;()
          .TheDefaultIs(() =&gt; new Database(Settings.Default.server))
          .CacheBy(InstanceScope.Hybrid);                
      }
  </code></pre>
  
  <p>I think I need to rewrite it to something like this?</p>
  
  <pre><code>public void ConfigureStructureMap()
  {
      ObjectFactory.Configure(x =&gt;
      {                
          For&lt;Database&gt;().Use(new Database(Settings.Default.server));                
      });
  }
  </code></pre>
  
  <p>This compiles but then I get a runtime error of:</p>
  
  <p>StructureMap Exception Code:  202
  No Default Instance defined for PluginFamily MyProject.Data.SqlRepository.Database</p>
  
  <p>What am I doing wrong? I am finding it hard to find documentation that relates to the latest syntax and not referencing deprecated methods :(</p>