Domanda

I need to use an external .dll file with itextsharp in my solution. Under development environment everything is fine. But same code in production server is giving an error. when checked in the log files, it shows:

Application error when access /_layouts/15/TransmittalRibbonControl/Transmittal.aspx, Error=The remote server returned an error: (401) Unauthorized. at System.Net.HttpWebRequest.GetResponse() at iTextSharp.text.pdf.RandomAccessFileOrArray..ctor(String filename, Boolean forceRead) at iTextSharp.text.pdf.TrueTypeFont.Process(Byte[] ttfAfm, Boolean preload) at iTextSharp.text.pdf.TrueTypeFont..ctor(String ttFile, String enc, Boolean emb, Byte[] ttfAfm, Boolean justNames, Boolean forceRead) at iTextSharp.text.pdf.BaseFont.CreateFont(String name, String encoding, Boolean embedded, Boolean cached, Byte[] ttfAfm, Byte[] pfb, Boolean noThrow, Boolean forceRead)

È stato utile?

Soluzione

Try adding the dll as SafeControl entry. Steps are given below:

  1. Navigate as shown below:

    enter image description here

  2. Under Advanced Tab, select as shown below:

    enter image description here

  3. Fill as shown below in the Add Existing Assembly window.

enter image description here

Note: You can place your dll in the web application's BIN folder in the server and pick like shown above.

Altri suggerimenti

Found the Solution at Last, Error=The remote server returned an error: (401) Unauthorized. at System.Net.HttpWebRequest.GetResponse() was from external font being called from _layouts/15/ and was not getting Authenticated from the server.

Reason for not getting authentication, when I was not able to open site from server using DNS name.

So once the above issue was resolved, my code started working fine.

Thanx a lot Muhammedh for the help...!!!

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top