Hey guys, I need the "Encoding" class from "microlib" but the second "Encoding" is default to use. What should I do?
Not sure I fully understand, but assuming you are trying to use 2 different versions of the same assembly:
Use the the Full Assembly Qualified Type Name to instantiate the Type you need.
A fully qualified Type name looks like this:
"WackyCars.ViewModels.CarsViewModel, WackyCars, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
Use it something like this:
Type oType = Type.GetType(AssemblyQualifiedTypeName.Trim()); if (oType != null) { //Got Type so create instance object asmObj = Activator.CreateInstance(oType, TypeConstructorArgs); if (asmObj != null) { //use the object } }
Please see here for details.
Hope this points you in the right direction,
Tim
Answers
hi @JiaxiangWang
Not sure I fully understand, but assuming you are trying to use 2 different versions of the same assembly:
Use the the Full Assembly Qualified Type Name to instantiate the Type you need.
A fully qualified Type name looks like this:
"WackyCars.ViewModels.CarsViewModel, WackyCars, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
Use it something like this:
Please see here for details.
Hope this points you in the right direction,
Tim