I have created an assembly(dll) in C#.net. It is for reading PDF files, so I have use “itextsharp” assembly as reference assembly in dll.
Now loading the assembly using dotnetfactory feature, I tried to use a function for reading the pdf file. I am getting following error.
External object PdfToText.PdfClass::ReadPdfFile has thrown the following exception:
Could not load file or assembly ‘itextsharp, Version=5.2.0.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca’ or one of its dependencies. Access is denied.
Where PdfToText is namespace name used in dll and PdfClass is class name.Function name is “ReadPdfFile”.
Set obj = DotNetFactory.CreateInstance("PdfToText.PdfClass","C:\myassembly.dll")
str=obj.ReadPdfFile("C:myfile.pdf")
Edit: Missed the error
Just add the itextsharp assembly to your referenced assemblies and that should solve the problem.