I am having a problem using the ScriptSettings global variable. I write my scripts using C# and compile them into a dll. Then I use the .config file AssemblyReference tag to have the Vegas script engine load my dll.
I can't pass the ScriptSettings global variable to the C# code. If I specify the type of the argument on the C# method as System.Xml.XmlDocument, eg:
public static void Hello(XmlDocument ScriptSettings)
I get he following exception:
Microsoft.Vsa.VsaException: UnknownError (0x801330FF): System.InvalidCastException: Specified cast is not valid.
I can pass the object to the C# code if I specify the type of the argument on the C# method as object. I.e.
public static void Hello(object ScriptSettings);
However, when I then try to cast it to an XmlDocument, I get the invalid cast exception.
I have verified that the type of ScriptSettings once passed to C# is System.Xml.XmlDocument, but I still can't cast it to that type.
Any ideas?
Thanks,
Randall Campbell
I can't pass the ScriptSettings global variable to the C# code. If I specify the type of the argument on the C# method as System.Xml.XmlDocument, eg:
public static void Hello(XmlDocument ScriptSettings)
I get he following exception:
Microsoft.Vsa.VsaException: UnknownError (0x801330FF): System.InvalidCastException: Specified cast is not valid.
I can pass the object to the C# code if I specify the type of the argument on the C# method as object. I.e.
public static void Hello(object ScriptSettings);
However, when I then try to cast it to an XmlDocument, I get the invalid cast exception.
I have verified that the type of ScriptSettings once passed to C# is System.Xml.XmlDocument, but I still can't cast it to that type.
Any ideas?
Thanks,
Randall Campbell