Last post Aug 07, 2014 01:47 PM by Yorrick vd Voort
Aug 05, 2014 06:03 PM|Xequence|LINK
I have 2 projects with a reference to the same class library. Our IOC for each project uses the same interfaces. The problem is, in solutionA our ioc resolves fine because we register the types, thus soutionB is missing the new registerTypes. How can I centralize
the unityContainer.RegisterTypes so both projects will be good to go?
Aug 07, 2014 12:59 PM|Yorrick vd Voort|LINK
Each project can have its own registration either in design time as in run time. Run time use is done via a unity config file, design time in startup class of the project. As long as you have all necessary Dlls in the corresponding bin folder you're fine.
Hope this helps,
Aug 07, 2014 01:24 PM|Xequence|LINK
Is there a way to verify unity dependencies resolve without error before code check in? The problem is my dll is changed by new checkin and thus referenced by a 'get latest' and new dependencies may appear. This will cause a checkin test level failure only
if the code has been tested but the fact is I cannot enforce this programming completely. The dependency test check in the other project will only fire if the code is checked in, which it is not but the new binary will have the dependency...
Aug 07, 2014 01:47 PM|Yorrick vd Voort|LINK
If you mean if the other project can use the DLL before it is checked in then yes there is. In the Post build events of the project you can add a Xcopy command that copies the build DLL to the projects that need it. Take a look at this post:
http://forums.asp.net/t/1997698.aspx?OOB+IOC+framework it contains a location of a small example project I created that does just that.
Hope it helps.