Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2005

Tip: Looking for answers? Try searching our database.

VSA Script

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jason - 07 Jul 2005 01:35 GMT
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"

Signature

Jason

Jakob Christensen - 07 Jul 2005 09:28 GMT
What's the error you are getting?
Did you remember to register your dll/typelib with regasm?

Regards, Jakob.

Signature

http://www.dotninjas.dk
http://www.powerbytes.dk

> How can i load my own dll in VSA script ?
> I have wrapped my own dll named RBA.MydotNetDB to perform database function
[quoted text clipped - 8 lines]
>         IVsaReferenceItem)
>     reference_item.AssemblyName = "RBA.MyDotnetdb"
Jason - 07 Jul 2005 09:31 GMT
I got VSAException

Signature

Jason

> What's the error you are getting?
> Did you remember to register your dll/typelib with regasm?
[quoted text clipped - 13 lines]
> >         IVsaReferenceItem)
> >     reference_item.AssemblyName = "RBA.MyDotnetdb"
Jakob Christensen - 07 Jul 2005 09:54 GMT
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.

Signature

http://www.dotninjas.dk
http://www.powerbytes.dk

> I got VSAException
>
[quoted text clipped - 15 lines]
> > >         IVsaReferenceItem)
> > >     reference_item.AssemblyName = "RBA.MyDotnetdb"
Jakob Christensen - 07 Jul 2005 10:08 GMT
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.

Signature

http://www.dotninjas.dk
http://www.powerbytes.dk

> Hi Jason,
>
[quoted text clipped - 32 lines]
> > > >         IVsaReferenceItem)
> > > >     reference_item.AssemblyName = "RBA.MyDotnetdb"
Jason - 07 Jul 2005 13:20 GMT
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

Signature

Jason

> 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.
[quoted text clipped - 37 lines]
> > > > >         IVsaReferenceItem)
> > > > >     reference_item.AssemblyName = "RBA.MyDotnetdb"
Jakob Christensen - 08 Jul 2005 08:09 GMT
Are you getting the exception "Microsoft.Vsa.VsaException:
AssemblyNameInvalid" when running the script or are you talking about a new
exception now?

Regards, Jakob.

Signature

http://www.dotninjas.dk
http://www.powerbytes.dk

> Thanks for the reply...
>
[quoted text clipped - 44 lines]
> > > > > >         IVsaReferenceItem)
> > > > > >     reference_item.AssemblyName = "RBA.MyDotnetdb"
Jason - 08 Jul 2005 09:48 GMT
Actually it is the same exception
Sorry for mislead
Signature

Jason

> Are you getting the exception "Microsoft.Vsa.VsaException:
> AssemblyNameInvalid" when running the script or are you talking about a new
[quoted text clipped - 50 lines]
> > > > > > >         IVsaReferenceItem)
> > > > > > >     reference_item.AssemblyName = "RBA.MyDotnetdb"
Jakob Christensen - 08 Jul 2005 11:44 GMT
Did you try with an assembly that has not been added to the GAC?

/Jakob

Signature

http://www.dotninjas.dk
http://www.powerbytes.dk

> Actually it is the same exception
> Sorry for mislead
[quoted text clipped - 53 lines]
> > > > > > > >         IVsaReferenceItem)
> > > > > > > >     reference_item.AssemblyName = "RBA.MyDotnetdb"
Jason - 08 Jul 2005 17:07 GMT
Or it is a better way to ask "how can i call and use my own dll inside VSA
script ?"

Signature

Jason

> Did you try with an assembly that has not been added to the GAC?
>
[quoted text clipped - 57 lines]
> > > > > > > > >         IVsaReferenceItem)
> > > > > > > > >     reference_item.AssemblyName = "RBA.MyDotnetdb"
Jason - 07 Jul 2005 09:42 GMT
Unhandled Exception: Microsoft.Vsa.VsaException: AssemblyNameInvalid
(0x80133005)

Signature

Jason

> What's the error you are getting?
> Did you remember to register your dll/typelib with regasm?
[quoted text clipped - 13 lines]
> >         IVsaReferenceItem)
> >     reference_item.AssemblyName = "RBA.MyDotnetdb"

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.