Problem with C# Script DLL

Steve Szudzik wrote on 5/12/2007, 9:45 AM
I'm looking for some help getting a Vegas script DLL working. I'm new to scripting for Vegas so I'm sure it's something simple that I'm missing.

I've created a new class library and named the class "EntryPoint" per most documentation that I've found. I've created 2 public static methods (seen a couple different ones in samples, so figured I'd try both) as:

public static void FromVegas(Vegas vegas, String scriptFile)
and
public static void FromVegas(Vegas vegas)

Vegas does see the DLL properly after placing it in the script folde, but when I try to invoke it, I always receive the below error. Any help would be greatly appreciated.

System.ApplicationException: Failed to create instance of main class: 'EntryPoint'.
at Sony.Vegas.ScriptHost.ScriptManager.Run(Assembly asm, String className, String methodName)
at Sony.Vegas.ScriptHost.PrecompiledScriptManager.Run()
at Sony.Vegas.ScriptHost.RunScript(Boolean fCompileOnly)

-_Steve

Comments

Steve Szudzik wrote on 5/12/2007, 9:59 AM
Never mind... I see that it works fine without the namespace defined...

Steve
SonyPJM wrote on 5/30/2007, 2:23 PM
The way to use a namespace/class that is not 'EntryPoint' is to create a script configuration file like so:


<script>
<MainClass>MyNamespace.MyClass</MainClass>
</script>


This way, a MyNamespace.MyClass object will be created and its FromVegas method will be called.