title: Dynamic proxy generation only for singletons?
body: <p>I am working on an implementation of log interceptor using <a href="http://www.castleproject.org/projects/dynamicproxy/" rel="nofollow noreferrer">Castle Dynamic Proxy</a> and <a href="http://structuremap.github.io/" rel="nofollow noreferrer">StructureMap</a>, so in my dependency registry I tell to StructureMap to decorate all instance of TrafficSourceRepository with a LoggingInterceptor. </p>
  
  <pre><code>var proxyGenerator = new ProxyGenerator();
  For&lt;ITrafficSourceRepository&gt;(Lifecycles.Singleton)
    .DecorateAllWith(instance =&gt; proxyGenerator
    .CreateInterfaceProxyWithTargetInterface(instance,
      new LoggingInterceptor(LogManager.GetLogger("AgencyPlayground"))))
  .Use&lt;TrafficSourceRepository&gt;();
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/MygKm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MygKm.png" alt="enter image description here"></a></p>
  
  <p>All seems to be fine, it works, but the TrafficSourceRepository will be instanciated as a <code>Singleton</code>, and I don't want to, so I change the lifetime of the resolved TrafficSourceRepositories as <code>Transient</code>:</p>
  
  <pre><code>var proxyGenerator = new ProxyGenerator();
      For&lt;ITrafficSourceRepository&gt;(Lifecycles.Transient)
        .DecorateAllWith(instance =&gt; proxyGenerator
        .CreateInterfaceProxyWithTargetInterface(instance,
          new LoggingInterceptor(LogManager.GetLogger("AgencyPlayground"))))
      .Use&lt;TrafficSourceRepository&gt;();
  </code></pre>
  
  <p>and it doesn't work anymore...
  It is a bug or I am doing something wrong?</p>