Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling Activator.CreateInstance returns an MissingMethodException

Status
Not open for further replies.

cochoa

Programmer
May 22, 2003
1
AR
Hi there, I am using reflection and calling System.Activator.CreateInstance with a ParameterInfo.ParameterType as a parameter. The value of ParameterInfo.ParameterType is {System.String}. However, this calls raises a MissingMethodException.

Can anyone help?
 
So if I understand correctly, you are trying to call System.Activator.CreateInstance(<String>) using reflection and passing an object of type ParameterInfo as a parameter. But if you are trying to actually call the CreateInstance method, it will need the actual values of the parameters, not just the types. So, .NET is trying to find the method System.Activator.CreateInstance(<ParameterInfo>), and that method doesn't exist. Instead of passing a ParameterInfo, just pass the actual String that you want to use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top