VSA Script

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can i load my own dll in VSA script ?
I have wrapped my own dll named RBA.MydotNetDB to perform database function
and i would like to use it inside my script..
Please help

I have sign my dll and add into global cache and when i called this it failed

reference_item = CType( _
items.CreateItem("RBA.MyDotnetdb.dll", VsaItemType.Reference,
VsaItemFlag.None), _
IVsaReferenceItem)
reference_item.AssemblyName = "RBA.MyDotnetdb"
 
What's the error you are getting?
Did you remember to register your dll/typelib with regasm?

Regards, Jakob.
 
I got VSAException

--
Jason


Jakob Christensen said:
What's the error you are getting?
Did you remember to register your dll/typelib with regasm?

Regards, Jakob.
 
Hi Jason,

Sorry, I misread your first post. I thought you were doing COM interop ;-)

To get the assembly references working in VSA you do not have to add the
assemblies to the GAC but you have to specify the full path to your assembly
for the AssemblyName property:

IVsaReferenceItem refItem = (IVsaReferenceItem)
Items.CreateItem("MyAssembly.dll", VsaItemType.Reference, VsaItemFlag.None);
refItem.AssemblyName = AppDomain.CurrentDomain.BaseDirectory +
"MyAssembly.dll";

I will try to get it working for the GAC and get back to you.

HTH, Jakob.
 
Come to think of it - you probably can not add a reference to an assembly
from the GAC. You need the dll to add the reference.

Regards, Jakob.
 
Thanks for the reply...

Actually i already add reference from my MainForm.dll and also import the
namespace .. I run my script from this dll. But when i run my script i just
said cannot find namespace and so on...
Please help
 
Are you getting the exception "Microsoft.Vsa.VsaException:
AssemblyNameInvalid" when running the script or are you talking about a new
exception now?

Regards, Jakob.
 
Back
Top