title: StructureMap Exception Code: 202 No Default Instance defined for PluginFamily
body: <p>I'm new to StuctureMap and I am writing a WCF service. In the existing code the previous developer used SturctureMap.</p>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>StructureMap Exception Code:  202<br>
    No Default Instance defined for PluginFamily MyCompany.SMS.Data.DataEntitys, MyCompany.SMS.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</p>
  </blockquote>
  
  <p>Here is the Code:</p>
  
  <pre><code>class a
  {  method aa
      {
         var db = ObjectFactory.GetInstance&lt;nsclaimsEntities&gt;();
      }
  }
  </code></pre>
  
  <p>When we are calling this code from an aspx.cs file it is working fine without any error, but I tried to wrap this code in a WCF webservice and it is throwing this exception.</p>
  
  <p>Here is the stack trace:</p>
  
  <pre><code>at StructureMap.BuildSession.&lt;.ctor&gt;b__0(Type t)
  at StructureMap.Util.Cache`2.get_Item(KEY key)
  at StructureMap.BuildSession.CreateInstance(Type pluginType)
  at StructureMap.Container.GetInstance(Type pluginType)
  at StructureMap.Container.GetInstance[T]()
  at StructureMap.ObjectFactory.GetInstance[PLUGINTYPE]()
  at NicorNational.SMS.CustDemographic.GetByAccountNumber(String acctNum) in C:\\Projects\\NicorNational.SMS\\CustDemographic.cs:line 105
  at NicorNational.Services.eCommerce.EligibilityService.GetEligibilityById(String accountId) in C:\\Projects\\Solutions\\NicorNational.Services.eCommerce\\EligibiltyService.svc.cs:line 23
  at SyncInvokeGetEligibilityById(Object , Object[] , Object[] )
  at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp; outputs)
  at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)"
  </code></pre>
  
  <p>Why do I get this exception?</p>