Add text to PDF using Aspose.PDF for.NET - Access is denied: 'Aspose.Pdf'

Hello,
I am testing the Aspose.Pdf 2.0 Version. Everything works fine in the applied Test-Projects an in some own small Testprojects (ASP.NET, VSS.NET, Framework 1.1).

Now i am testing it in a bigger Project and in 4 of 5 Walktroughs i get the following Error.

Access is denied: 'Aspose.Pdf'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileLoadException: Access is denied: 'Aspose.Pdf'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Assembly Load Trace:
The following information can be helpful to determine why the assembly 'Aspose.Pdf' could not be loaded.

=== Pre-bind state information === LOG: DisplayName = Aspose.Pdf, Version=2.0.3.0, Culture=neutral, PublicKeyToken=716fcc553a201e56 (Fully-specified) LOG: Appbase = file:///D:/where2dig/WHERE2DIG LOG: Initial PrivatePath = bin Calling assembly : where2dig, Version=1.1.6.0, Culture=neutral, PublicKeyToken=null. === LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/where2dig/4d5687f0/53989b09/Aspose.Pdf.DLL. LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/where2dig/4d5687f0/53989b09/Aspose.Pdf/Aspose.Pdf.DLL. LOG: Attempting download of new URL file:///D:/where2dig/WHERE2DIG/bin/Aspose.Pdf.DLL. 

I can restart the IIS and everythig works fine until the next run. But this isn't very helpful, because after the Restart i c'ant use the Debugger.

Here are the important Codelines:
//PDF_Dokument anlegen
Pdf myPdf = new Pdf();
//Dokument an das XML-Template binden

myPdf.BindXML(@"D:\AnswerTemplate.xml",null);
Section sec1 = myPdf.Sections[0];
Text text1 = sec1.Paragraphs["Vnummer"] as Text;
text1.Segments["Vnummer"].Content = strVnummer;

Text text2 = sec1.Paragraphs["Ort"] as Text;
text2.Segments["PLZ"].Content = strPLZ;
text2.Segments["Ort"].Content = " " + strOrt;
text2.Segments["Stadtteil"].Content = " " + strStadtteil;

Text text3 = sec1.Paragraphs["Strasse"] as Text;
text3.Segments["Strasse"].Content = strStrasse;
text3.Segments["Nummer"].Content = " " + strNummer;

Please help, cause i hope i can use this ecellent tool.Stick out tongue
...but not with this errorSad

Dear joerg,

Thank you for considering Aspose.

This error seems caused by the permission setting of your web server. I am not familiar with web server so I can’t give you advise. I will ask other developers if they have any idea about this error.

Hi

The IIS webserver and the ASP.NET framework has only some permissions to the filesystem. The above error indicates that the ASP.NET Account of the server has NOT been granted access to the location: D:/where2dig/WHERE2DIG. This is filesystem (NTFS) access.
Solution 1)
Make sure in the VS-project, that you have set “copy local = true” to allow VS.NET to make a copy of the Aspose.Pdf assembly to your local bin-folder.

Solution 2)
Include the acccount ASPNET machine account (in which your IIS is running its projects by default) in the access list on the file folder (D:/where2dig).

Hi,

thanks for the fast answers. I really forgot to grant access to the ASPNET-User on the Project-Path. So now everything ist working fine.

joerg

Dear all

Where exactly did you do the setting? I did go to the project folder under WWWroot folder and gave access to the ASPNET account but no use. The Copy Local=true exists for the DLL. I still get error.

rgds

Pavan

Hi , Pavan

Plz take a look at this page, I think it will do a little help for you.

http://www.asp.net/security.aspx?tabindex=0&tabid=1

Best regards

Dear Kevin,

I did this already and infact gave Full Control to the ASPNET account to the Web folder but of no use. I have to restart the computer almost everytime I wish to run the code.

rgds

Pavan

Thanks for considering Aspose.

I think this problem comes from system Indexing Service, so my advice is :

If you do not use Index Server on the server, you can disable it. To do so, follow these steps:

1. Click Start, and then click Services.
2. Locate Indexing Service from the list of services, and then click Indexing Service Properties from the subform.
3. On the General tab of the Indexing Service Properties dialog box, in the Startup type drop-down item list, click Disabled.
4.

Click OK.

If you use Index Server, you can exclude the Temporary ASP.NET Files directory from the folders that the Index Server scans. To do so, follow these steps:

1. Click Start, point to All Programs, point to Administrative Tools, and then click Computer Management.
2. Expand the Services and Applications node, expand the Indexing Service node, and then expand the System node.
3. Right-click the Directories folder, point to New, and then click Directory from the subform to open the Add Directory dialog box.
4. Click Browse, and then locate the Temporary ASP.NET Files directory. You typically find the Temporary ASP.NET files in the following path: c:\\Microsoft.NET\Framework\\Temporary ASP.NET Files
Note is the version of .NET Framework installed on your computer.
5. Click No under the Include in Index? option buttons.
6. Click OK to close.
7. Close the Computer Management dialog box.
8. Restart the Indexing Services service.