G
Guest
**************************************
//Load the Assembly
Assembly a = Assembly.LoadFrom(sAssembly);
//Get Types so we can Identify the Interface.
Type[] mytypes = a.GetTypes();
BindingFlags flags = (BindingFlags.NonPublic | BindingFlags.Public |
BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly);
//Iterate through the Assembly to find Class with a Public Interface.
//****Each Assembly should only have one Public Entry Point****
//****using this method to expose that method and pass the XML data to it****
foreach (Type t in mytypes)
{
MethodInfo[] mi = t.GetMethods(flags);
Object obj = Activator.CreateInstance(t);
**************************************
I am trying to dynamically call an assembly. The Assembly name is being
pulled from a SharePoint List and in this case it is called TransformXML. I
am getting the following error when it gets to the Activator...
ERROR:
**********************************************************
*An unhandled exception of type 'System.MissingMethodException' occurred in
* *mscorlib.dll
*
*
*
*Additional information: No parameterless constructor defined for this
object *
**********************************************************
I am also including the code from the class being called.
Transform.dll
**************************************************
public class CreateTransform
{
#region Public Methods
public CreateTransform()
{
}
public CreateTransform(string sXML, Microsoft.SharePoint.SPListItem
_spListItem)
{
//System.Xml.XmlDocument xmlDoc;
Microsoft.SharePoint.SPAttachmentCollection spAttachColl =
this.GetXSLTransform(_spListItem);
this.TransformXML(sXML,spAttachColl);
}
#endregion
//Load the Assembly
Assembly a = Assembly.LoadFrom(sAssembly);
//Get Types so we can Identify the Interface.
Type[] mytypes = a.GetTypes();
BindingFlags flags = (BindingFlags.NonPublic | BindingFlags.Public |
BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly);
//Iterate through the Assembly to find Class with a Public Interface.
//****Each Assembly should only have one Public Entry Point****
//****using this method to expose that method and pass the XML data to it****
foreach (Type t in mytypes)
{
MethodInfo[] mi = t.GetMethods(flags);
Object obj = Activator.CreateInstance(t);
**************************************
I am trying to dynamically call an assembly. The Assembly name is being
pulled from a SharePoint List and in this case it is called TransformXML. I
am getting the following error when it gets to the Activator...
ERROR:
**********************************************************
*An unhandled exception of type 'System.MissingMethodException' occurred in
* *mscorlib.dll
*
*
*
*Additional information: No parameterless constructor defined for this
object *
**********************************************************
I am also including the code from the class being called.
Transform.dll
**************************************************
public class CreateTransform
{
#region Public Methods
public CreateTransform()
{
}
public CreateTransform(string sXML, Microsoft.SharePoint.SPListItem
_spListItem)
{
//System.Xml.XmlDocument xmlDoc;
Microsoft.SharePoint.SPAttachmentCollection spAttachColl =
this.GetXSLTransform(_spListItem);
this.TransformXML(sXML,spAttachColl);
}
#endregion