Unity doesn't work
Posted
by Budda
on Stack Overflow
See other posts from Stack Overflow
or by Budda
Published on 2010-05-20T15:46:20Z
Indexed on
2010/05/20
15:50 UTC
Read the original article
Hit count: 912
Yesterday I've implemented the code:
CustomerProductManager productsManager = container.Resolve<CustomerProductManager>();
It was compilable and working.
Today (probably I've modified something I am constantly getting the error:
The non-generic method 'Microsoft.Practices.Unity.IUnityContainer.Resolve(System.Type, string, params Microsoft.Practices.Unity.ResolverOverride[])' cannot be used with type arguments
My collegue has the same source code and doesn't have same error. Why? How to resolve the problem?
P.S.
line "using Microsoft.Practices.Unity;" is present in usings section.
I've tried to replace generic version with non-generic one:
CustomerProductManager productsManager = (CustomerProductManager)container.Resolve(typeof(CustomerProductManager));
And got another error:
No overload for method 'Resolve' takes '1' arguments
It seems like one of the assemblies is not referenced.. but which one? I have 2 of them referenced: 1. Microsoft.Practices.Unity.dll 2. Microsoft.Practices.ServiceLocation.dll
P.P.S. I've saw similar problem http://unity.codeplex.com/WorkItem/View.aspx?WorkItemId=8205 but it is resolved as "not a bug"
Any thought will be helpful
© Stack Overflow or respective owner