Free Support Forum - groupdocs.com

How to put a license into the production server IIS

Dear sirs

We have been developing with your Viewer for .NET. Once we have turned it into production, we see a banner in red when rendering documents. Please see the attacehd image.

How can we avoid this banner in the producttion enviroment?

Thanks in advance,
JF


@josefernandez


Thanks for using GroupDocs.Viewer for .NET.

You are getting this message because the API license is not applied. Please make sure that you have applied the license by providing the correct path of the license file in your application. You can put your license file in some directory in the production server and allow the IIS user to have read access to that directory. For details on how to apply the license, please visit this article.

In case you would have any issues, please do let us know.

Warm Regards

Dear Sirs,

I am using the following method to apply the license by opening the file using a stream from the Utilities.vb class:

Public Shared Sub ApplyLicense ()
Dim lic As New License ()
Dim licPath As String = Path.Combine (rootPath, licensePath)
Using st As Stream = File.OpenRead (licPath)
Lic.SetLicense (licensePath)
End Using
End Sub

When I call it from the aspx page, I assign the rootPath path. For testing purposes I am sending a header to the client to check the path:

Utilities.rootPath = HttpContext.Current.Request.PhysicalApplicationPath
Response.AppendHeader (“PathLic”, Path.Combine (Utilities.rootPath, Utilities.licensePath))
Utilities.ApplyLicense ()
Dim ms As New MemoryStream (buffer)
Response.Clear ()
Response.Write (ViewGenerator.RenderDocumentAsHtmlToString (ms, Nothing))
Response.Flush ()
Response.End ()

I have double checked the path to the license file returned in the header and it is absolutely correct.

I also have found that there is no error reading the file, but the message “Evaluation only …” continues to appear.

Any idea why it might happen?

Thank you very much in advance.
José Fernández

@josefernandez,


Thanks for sharing the details.

One possible reason is that the API is picking up the cached information of the documents. Please remove all the files from the temp/cache folder located in the storage directory (which you set in viewer configuration) of your application and try to view the document again. Furthermore, please provide us the following details.

  1. Is the license file working without any issue on your development server?
  2. Does the application has rights to access (read) the license file?
  3. Please share with us the version of GroupDocs.Viewer for .NET API you are using.
  4. Please share with us the subscription expiry date (you can find your subscription expiry date in your license file).

We shall be looking forward to your response.

Warm Regards

Thanks to you for your help.

1 Is the license file working without any issue on your development server?
Yes, in the development i haven’t any problem

2 Does the application has rights to access (read) the license file?
Yes, the application has access and the file load by stream without errors, the IIS_IUSRS has read permissions

3 Please share with us the version of GroupDocs.Viewer for .NET API you are using.


4 Please share with us the subscription expiry date (you can find your subscription expiry date in your license file).
20180707

@josefernandez,


Thanks for your response.

I am using the following method to apply the license by opening the file using a stream from the Utilities.vb class:

Public Shared Sub ApplyLicense ()
Dim lic As New License ()
Dim licPath As String = Path.Combine (rootPath, licensePath)
Using st As Stream = File.OpenRead (licPath)
Lic.SetLicense (licensePath)
End Using
End Sub

Please make changes in the highlighted code line (as shown below) and check if it is working at your end. Please don’t forget to remove all the cached files in temp/cache folder before running the application again.

Public Shared Sub ApplyLicense ()
Dim lic As New License ()
Dim licPath As String = Path.Combine (rootPath, licensePath)
Using st As Stream = File.OpenRead (licPath)
Lic.SetLicense (st)
End Using
End Sub

We shall be looking forward to hear from you.

Warm Regards

Thank you so much for your help, i not saw the error.


@josefernandez,


You are always welcome.

Warm Regards

Your article reflects the issue people are concerned about. The article provides timely information that reflects multi-dimensional views from multiple perspectives. I look forward to reading quality articles that contain timely information from you. fblogin

@fblogin31,


Thanks for coming to our forum. If you’ve any questions or queries related to GroupDocs APIs, please feel free to post.

Thanks