I’m trying to figure out how to register a type at run-time using unity. Any Suggestions?
Basically I want to be able to do this:
Container. RegisterType(Of IMyInterface)( Type.GetType('Fully Qualified Type Name'))
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use the non-generic overloads of RegisterType.
The non-generic version of the methods take a simple type instance and do reflection, so this should do what you want. Code in C# rather than VB, but you get the idea…