Security Exception on the Deployment Server

Hi Ken, I am evaluating the product, I want to use it for all my clients in the future, but I have run into some problems. I tried going through your knowledge base and also the host’s support docs but to no avail.


I have been trying to get the pdf.form working on the host server (www.1and1.com - Windows 2003 Server) but with no luck. I am able to run the code on my Development Server with no problems.

Here is the code, it fails at the first access to the .pdf file.

Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim templatePdf As String = Server.MapPath(“pdfs\RealEstateLoanApplication.pdf”)

Dim outputPdf As String = Server.MapPath(“pdfs\output.pdf”)

'First a input pdf file should be assigned

Dim form As Form = New Form(templatePdf, outputPdf) 'Fails right here ******

'END CODE *******




If I mark out the dim form as Form = …, the code goes through.

I am attaching the error page as a Word document.

Appreciate your early response.

Regards,

Senthil.

Dear Senthil,

Thanks for considering Aspose.Pdf.Form.

1) Make sure that you have the privilege to read and write the directory.
2) What kind of font do you use in the Text Field of your pdf? Maybe it has relation with the font because the program will read the font resource file if the font is not the 14 bulidin font. Make sure that you have the right to read the font source directory like “c:/windows/fonts”.

Best regards.

Hi Ken, thanks for the quick reply.

I am using the same font as your examples, "Helvitica", Size=10.

I tried to use your example file "MailTemplage.pdf" on the host (www.1and1.com) server but received the same error.

Everything works fine on my Development computer.

I have given the maximum permission allowed to me by "1and1" to the "PDF" folder, I have a "Windows Developer account" with them.

I downloaded the latest fix's you have from your website.

Please advice,

Regards,

Senthil.

Dear Senthil,

It is a Security Exception. It seems a problem about rights setting of Web stie. I will discuss it with other developers.
In my program, just reading some file and creating some file… Did you use some security settings on your pdf file?

By the way, you could compare the setting of your development machine to the deployment machine.

Best regards.

Hello Ken,
I don't have any security settings on the .pdf file, I also tried using your example file.


I do agree it is a security issue with the website on the deployment server. I don't have much control on the configurations of IIS on the deployment server. I use the FTP and the 'control panel' provided by 1and1. I did change the permissions of the directory where the .pdfs' are stored.

Thank your for your prompt response and handling of this issue. I will wait for your response after you talk it over with your other developers.

Regards,

Senthil Kumar

Dear Senthil,

I have analyzed your error message and discussed it with our developers. And I think the error information is too lack. It just said there is a Secrity section in “Page_load”, but not said how to cause this.

I have some suggestions about this:

  1. Have you used form.Save() in your code? you could attach the code which includes Aspose.Pdf.Form. Just write a simple program using Aspose.Pdf.Form which is a console program and test whether the error will occur.
  2. Write the simplest program in a asp.net using Aspose.Pdf.Form and test whether ok.
  3. Try to give me more exception information because your case is singular.

By the way, you could read this post , maybe it is helpful to you.

Best regards.

Hi Ken, I am including the code for the simple program that still breaks on the deployment server. I think this is a case of what is perceived as ‘Safe component’ or not by the host (1&1.) Please see what can be done with regards to that.

I am planning to change my plan and go for a dedicated server with them, hopefully the problem should get resolved then.

Just out of curiosity, do you have any clients who are 1and1 customers & are successfully running this component.

Do you recommend any other host?

Regards,

Senthil.

Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim templatePdf As String = Server.MapPath(“pdfs\mailTemplate.pdf”)
Dim outputPdf As String = Server.MapPath(“pdfs\output.pdf”)
Dim form As Form = New Form(templatePdf, outputPdf) ’ THE CODE BREAKS RIGHT HERE! THIS IS A PERMISSION ISSUE

'‘We can fill a text field like this:
form.FillField(“From”, “This is a new line!”)
form.FlattenField(“From”)
’'Save the changes.
form.Save()
End Sub

Dear Senthil,

We’re hosting with [webhost4life]. The demos of Aspose.Pdf.Form is hosted at Aspose.Pdf.Forms | Aspose.PDF for .NET API Reference. It does not write the pdf files on the server but I will request Ken to do that to test your server security issue.

If it can write the merged pdf files there I would recommend [webhost4life] since it’s really popular and its web server security configuration is reasonable. If it fails to write the merged pdf files, I would request Ken to investigate his implemention to clear off all server security indications.

Anyway, I appreciate your patience and Ken will try to help you to revolve this issue ASAP.

Dear Senthil,

Please download the new hotfix in the attachment and try it.
Its version is 1.2.1.0.

Best regards.

Hi Ken, I tried the download with no luck.

Any other suggestions.

Regards,

Senthil.

Dear Senthil,

Could you run your program in your deployment machine?
Complie your program in “Debug” mode and upload your *.dll and *.pdb to your deployment machine. Maybe need to change in the web.config to see the error message.

Please try to do this if you have enough rights because enough error message is useful to locate the problem.

And also I will test the program in our host which is the same os and .net version as you.

Best regards.

Dear Senthil,

I have just tested the new dll on our site and it works well.
And I found a bug which is caused by a new upgrade of a new function.

Please download the new version and tested it.
Thanks for your patience.

Best regards.

Dear Ken, thank you for the reply. I tried the new download with the same problem.

I have compiled the code in ‘Debug’ mode and uploaded both the .dll & .pdb files to the ‘bin’ folder. I have also set
<customErrors mode=“Off”/>
<identity impersonate=“true”/>
in the web.config file.

You can see the error at http://www.sivasolutions.com/northwind.aspx

I will wait for your suggestions/fix.

Thanks for your prompt reply,

Regards,

Senthil.

Hi Ken,
I spoke to 1and1.com and they have agreed to look at adding aspose.dll to their ‘CAS’ policy.

In the meantime, I have to admit I have been very impressed by the efforts & professionalism of your team to solve my problem over the weekend.

I am not only going to get your product with ‘Developer OEM Subscription’ but already went ahead and took one more ‘Semi Dedicated Server’ with www.webhost4life.com as per your advice to use your component till the issue with 1and1 is resolved.

Hopefully, you will have a fix for me or no problems, I will host my clients who need to use your product on webhost4life.com

Thanks & Kind regards,

Senthil.
www.sivasolutions.com

Dear Senthil,

Thank you for your understanding.

But I’m very interested in making our products very friendly to all available hosting servers so I need your cooperation.

Would you please download Aspose.Pdf then host its Northwind demos in your hosting server? Please change its code to allow the Northwind demos to write pdf documents in your server. Then please let me know if Aspose.Pdf is allowed to write pdf documents to your hosting server.

This may be helpful for Aspose.Pdf.Form team to fix your current issue completely.

Thanks in advance.

Hello, I have tried that too. By the way here is the response I got from 1and1.com ‘Admin’ team.

Start Email from 1and1 **********************

Thank you for contacting us. Please note that we cannot host strong named dll’s in the shared ms packages.

If you have any further questions do not hesitate to contact us.

End Email from 1and1 **********************

I am more than happy to co-operate with you. Please let me know how I can be of assistance. I will try to do what you have suggested once again, though I have already tried it.

Regards,

Senthil.

Dear Senthil,

Your hosting’s email is really helpful for us. However, I do not consider their security policy is reasonable. Strong named assemblies are standard practice recommended by Microsoft so our developers did not do anything wrong.

By the way, if you want to host with [webhost4life], you do not need to host with their Semi Dedicated Plan if you just want to fix the current issue. Their Shared Hosting Plan is good enough for our components because we used to host with Shared Hosting Plan.

Feel free to let us know if we can be of help.

Thanks for the reply. I agree with you but we can’t do anything regarding the host’s policies.

I had to get the ‘Semi Dedicated Plan’ because I need the bandwidth, space, the freedom to tweak stuff in the futureBig Smile (I host a few Shopping Carts for my clients.)


Please let me know if you guys figure something out with regards to this issue. In the meantime, I have been able to test your product on my development server and am very happy with it. I will purchase it today and hopefully things will workout much better with webhost4life.

Thanks & Kind Regards,

Senthil.

Dear Senthil,

Our assemblies must be strong named as our licensing is based on strong named assemblies. So to license our components, your hosting needs to support strong named assemblies.

If your current hosting plan with [www.1and1.com] does not allow you to run strong named assemblies, could you please consider to upgrade to a hosting plan that allows you to do that? This is probably the best solution for your current issue as assemblies from most serious component vendors are strong named. So when you license components from other component vendors later on, you will have the same problem too.

I’m glad to know you will have [webhost4life] Semi Dedicated Plan soon. Actually we just moved to this plan recently and all our components run perfectly without any security issue.

Feel free to let us know if you’re happy with our suggestions.

Hello Guys, just wanted to let you know, the component runs great on the WebHost4Life server. I had absolutely no problems setting it up. Will purchase the product now and deploy it.


Thanks for all your help,

Regards,

Senthil Kumar.

www.sivasolutions.com