Forum Discussion

fayrehouse's avatar
fayrehouse
Frequent Contributor
11 years ago
Solved

Am I misunderstanding the CLR Bridge?

Hi All,



As part of my efforts to be able to diseminate PDFs from within my TC project, I've come across iTextSharp - http://sourceforge.net/projects/itextsharp/



L
ooking at some examples of iTextSharp in use at http://simpledotnetsolutions.wordpress.com/2012/04/08/itextsharp-few-c-examples/ I was under the impression I could download iTextSharp, add the DLL(s) to the CLR Bridge, reload, and then in my script I could then do something like:

var my iTSObject = dotNet_iTextSharp_text_pdf_parser.pdfreader.zctor() (or something to that effect)



But having added my iTextSharp DLL to the CLR Bridge, and reloaded - no new namespaces are listed under the dotnet object.



Can anyone advise where I'm being an idiot? :) Someone once said "there is no such thing as a stupid question". I'm not so sure here... but help!? :)
















  • Hi Steve, I had a similar problem when trying to utilise the WinSCP assembly to perform SFTP tasks.



    I solved the issue by registering the assembly in the GAC and importing it into Test Complete from there.



    I think it has something to do with other assemblies it requires being available.

4 Replies

  • Philip_Baird's avatar
    Philip_Baird
    Community Expert
    Hi Steve, I had a similar problem when trying to utilise the WinSCP assembly to perform SFTP tasks.



    I solved the issue by registering the assembly in the GAC and importing it into Test Complete from there.



    I think it has something to do with other assemblies it requires being available.
  • Philip_Baird's avatar
    Philip_Baird
    Community Expert
    Hi Steve, I think it's like any .Net application, if libraries aren't registered then all referenced Assemblies need to be in same directory. If you determined all the Assemblies iTextSharp references and put them in the same directory, I'm guessing load from file would probably work.

  • fayrehouse's avatar
    fayrehouse
    Frequent Contributor
    Thanks Phil,



    I'll give that a go - seems despite being a member of the administrators group on my laptop, I don't have "full" admin priviledges to run gacutil.exe.



    That said, this does make me wonder what the "browse file" button / option is for in the CLR Bridge, if ALL references have to be via the GAC.... Sounds like a bug in TC potentially?!



    Anyone from SmartBear care to comment / advise?
  • fayrehouse's avatar
    fayrehouse
    Frequent Contributor
    Hi Phil - apologies for the delay in this comment....



    Just wanted to say adding the lib to the GAC worked! .... Adding it to the GAC itself was a bit of a pain - largely down to our IT security policy here (!)... But eventually I was able to drag the dll into c:\windows\assembly - and job done :)



    THanks four your comments :)