« Return to Thread: Calling Assembly from ASP

Re: Calling Assembly from ASP

by Paulo Soares-3 :: Rate this Message:

Reply to Author | View in Thread

Maybe it can find the assembly but you are not running fully trusted.

Paulo

----- Original Message -----
From: "Shawn Davies" <Shawn.Davies@...>
To: <itextsharp-questions@...>
Sent: Friday, June 05, 2009 8:32 PM
Subject: [itextsharp-questions] Calling Assembly from ASP


Hello,

I’m new to this mailing list, so I hope I’m posting my question correctly.
:)

I wrote a class that uses iTextSharp to create a PDF document. This works
great in my .NET web site. Going forward, I have some classic ASP pages in
which I would like to implement this assembly, and I’ve run into a bit of a
snag.

My ASP code:
<%
  Dim myObject
        Dim output
        Dim strConStr
        strConStr = Application("Connection_String") & ";Workstation ID='" &
Request.Cookies.Item("UserID") & "'"
        set myObject = Server.CreateObject("CustomPDF.CreatePdf")
        output = myObject.CreatePdfData(strConStr, 150000, strSQL,
"AdInventory", "OutputPdf.pdf")
        myObject = nothing
        Response.ContentType = "application/pdf"
        Response.AddHeader "Content-Disposition", "filename=OutputPdf.pdf"
'&strFilename
        Response.Write(output)
%>

The “CustomPDF.CreatePDF” class is C# written on the 2.0 Framework. I’m
executing this code on a website running on Windows 2003 server. When I run
the above code, I get the error below. The “CustomPDF.CreatePdf” class is
being instantiated, but the error is thrown when I make the call to
“CreatePdfData”.

ExportToPDF error '80070002'

Could not load file or assembly 'itextsharp, Version=4.1.2.0,
Culture=neutral, PublicKeyToken=8354ae6d2174ddca' or one of its
dependencies. The system cannot find the file specified.

1.       I added iTextSharp.dll to the GAC.

2.       I successfully registered my dll and the iTextSharp.dll using
regasm.exe (2.0 framework).

Can anyone tell me why the system can’t find iTextSharp?

Thanks!
Shawn

Shawn Davies
Senior Software Engineer, Macrovision Solutions Corporation
Shawn.Davies@... |  Office: 918-488-4052 |  Fax: 918-488-4245


CONFIDENTIALITY NOTICE: This email message (including any attachments) is
for the sole use of the intended recipient and may contain confidential and
privileged information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the intended recipient, please
contact the sender by reply email and destroy all copies of the original
message. Thank you.




------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

 « Return to Thread: Calling Assembly from ASP