Accessing my assembly works with js, not with vb

roger_74 wrote on 3/3/2003, 6:42 AM
In JScript I can do this:
import SonicFoundry.Vegas;
import EnvelopeVB;

EnvelopeVB.Form1.ShowUI();

It works perfectly. But if I try it in Visual Basic, it doesn't work:
Imports SonicFoundry.Vegas
Imports EnvelopeVB

Public Module MainModule
Sub Main()
EnvelopeVB.Form1.ShowUI()
End Sub
End Module

I get:

"Error running:

Any ideas?

Comments

SonyPJM wrote on 3/3/2003, 9:11 AM

Do you have a script configuration xml file with the same name as the
VB script? It should have the same file name as the script but have
the '.xml' extension rather than '.vb'.
SonyPJM wrote on 3/3/2003, 10:02 AM
Never mind that... I was just able to reproduce the problem. Unless I can find a work-around, I'm afraid that referencing external assemblies from a VB script is not supported.
roger_74 wrote on 3/3/2003, 10:02 AM
The js and vb files have the same name apart from the extension, so I'm using the same xml-file.
roger_74 wrote on 3/3/2003, 10:03 AM
Ok, thanks
SonyPJM wrote on 4/3/2003, 9:59 AM
I finally found a work-around for this problem. You have to put your assembly in the same directory as Vegas40.exe and SonicFoundry.ScriptHost.dll.

I'm still looking for a better solution so you can put the assembly anywhere you want (typically in the same directory as the script.
lnetzel wrote on 7/16/2003, 6:10 AM
i just bumped into the same problems and I go tit working by putting the assebly in the Installationfolder of Vegas 4. But Maybe it has something to do with the XML configuration?

<?xml version="1.0" encoding="UTF-8" ?>
<ScriptSettings>
<AssemblyReference IsLocal="true">MyAssembly.dll</AssemblyReference>
</ScriptSettings>

I was thinking about that IsLocal="true" .. maybe you can do something different here?

Since is was a while ago since this was disscus in this thread maybe someone has come up with a workaround?
roger_74 wrote on 7/16/2003, 6:41 AM
If you omit IsLocal you can give the full path to the assembly. But IIRC it didn't help.
SonyPJM wrote on 7/21/2003, 1:49 PM
With VB, the dll must go in the Vegas install directory... As far as I've been able to determine, the limitation is in the VB script engine. The IsLocal attribute should be false or missing for VB script configuration file AssemblyReference elements.