views:

67

answers:

1

Hi,

I've just started an MVC 2.0 solution using Unity 2.0. I thought it would be a good idea to create my Unity Container with all the RegisterType calls within a separate assembly to allow me to reuse it throughout my Unit Tests. However, I quickly realised I'd end up with circular references regardless of unit testing. My MVC application would require a reference to the new assembly and of course my assembly needs a reference to the MVC application to resolve the controllers.

Apologies if I'm missing something really obvious here but is this something anyone else has experienced and if so how did you overcome this problem to allow reuse of your Unity container "definition" throughout your solution such as Unit Tests?

+1  A: 

Daz, see the answer I provided to this stackoverflow question: I think it may help with the situation you described. Let me know if it doesn't help.

Chris Symons