Problem while posting my project into the server of the company.

Hello. I have been doing a project in the server side and all works fine. What i am doing is publishing the project into a server. The project works fine but I made some changes that made the project not to work fine in the server any more. I added the function of SyncFusion SfPdfViewerServer but to do this i needed to download a nuget package (Syncfusion.Blazor.PdfViewerServer.Windows). When I tried to download that package the project responded with and error saying that i should update Syncfusion.Blazor package before installing the other one. So I update first Syncfusion.Blazor and then install Syncfusion.Blazor.PdfViewerServer.Windows. After this I made the code that i needed to show a pdf and locally in my pc works fine. Then I went to the server to publish the project like I always do.
The project is compiling itself in a good way

But when i go to my main page I have the following error:


I dont get what the error means. Is it a problem with something related with popups? I think that the problem is with the last version of syncfusion because before this I dont have this problem. Thanks and greetings!

22 Replies 1 reply marked as answer

AA Akshaya Arivoli Syncfusion Team November 9, 2020 12:59 PM UTC

Hi Matias,  

Thank you for contacting Syncfusion support.  

As per the provided details, we were unable to reproduce the reported issue locally. However we will try to reproduce the issue in the hosted environment and update you with more details on Novvember 10, 2020  

Regards,  
Akshaya  



UH Uwe Hein November 9, 2020 03:14 PM UTC

Hi Akshaya,

     see thread ID 159503 - looks quite like the error I encounter.

       regards

          Uwe


MM Matias Mutz November 9, 2020 03:57 PM UTC

Hi Uwe,

Yes, it seems to be the same problem as you had. It seems to be a problem with the last version. Hope that tomorrow with the details we can solve this problems.

Regards,
Matias.


AA Akshaya Arivoli Syncfusion Team November 10, 2020 04:12 PM UTC

Hi Matias,  

We have validated the reported issue and confirmed the same as a bug. The fix for this will be included in our upcoming weekly patch release which will be scheduled for November 18th, 2020. 
     
The status of the issue can be tracked from the below feedback and the same can be found from the below link.   


Please let us know if you have any concerns.   

Regards, 
Akshaya 



MM Matias Mutz November 10, 2020 05:27 PM UTC

Hi Akshaya,

Thanks for the reply. I will wait for the new version and after that i will let you know if everything goes well.

Best Regards, Matias.


AA Akshaya Arivoli Syncfusion Team November 11, 2020 06:55 AM UTC

Hi Matias, 

As mentioned earlier we will update you with further details on November 18, 2020 

Regards, 
Akshaya 



MM Matias Mutz November 18, 2020 07:29 PM UTC

Hi Akshaya,

Now the projects works fine while deploying it so thanks. The problem i have now is with the pdf viewer. Locally in my pc this works well but in when I deploy the project dont work anymore. Do you know what can be happening? The root to the file I am sure that it is well given.



Also when I try to open with the open button the pdf viewer keeps charging so I think that it wont work unless i change something.

Best regards, Matias.


AA Akshaya Arivoli Syncfusion Team November 19, 2020 02:59 PM UTC

Hi Matias, 

Thank you for your update.  
  
The provided information was not clear to us, so we would like to have more details about your issue, console errors, exception details, screenshots, network details and the code snippet with replication procedure. These details will be helpful for us to investigate further and assist you better. 


Regards, 
Akshaya 



MM Matias Mutz November 19, 2020 05:26 PM UTC

Okey. I will give you more information. The code i am using to show the pdf is the following one:

@page "/Pdf/{codigo}/{accion}"
@using Microsoft.AspNetCore.Components;
@using Microsoft.JSInterop;
@using SupplyChain;
@using Syncfusion.Blazor.FileManager;
@using Syncfusion.Blazor.Grids;
@using Syncfusion.Blazor.Navigations;
@using Syncfusion.ExcelExport;
@using System;
@using System.Collections.Generic;
@using System.Linq;
@using System.Net.Http;
@using System.Net.Http.Json;
@using System.Text.Json;
@using System.Threading.Tasks;
@using System.Web;
@using System.IO;
@using Syncfusion.Blazor.PdfViewer;
@using Syncfusion.Blazor.PdfViewerServer;
@if (rutas == null)
{
    <p><em>Loading...</em></p>
}
else
{
    if (accion == "RUTAOF")
    {
        @foreach (Solution ruta in rutas)
        {
            if (ruta.CAMPO == "RUTAOF")
            {
                codigo = ruta.VALORC + codigo.Substring(0, 7) + ".pdf";
                    <div class="control-section">
                        <SfPdfViewerServer DocumentPath="@codigo" Height="640px" Width="100%"></SfPdfViewerServer>
                    </div>
                    <label>No hay un plano asociado a la orden de Fabricación.</label>
            }
        }
    }
    if (accion == "RUTACNC")
    {
        @foreach (Solution ruta in rutas)
        {
            if (ruta.CAMPO == "RUTACNC")
            {
                codigo = ruta.VALORC + codigo.Substring(0, 7) + ".txt";
                if (File.Exists(codigo))
                {
                    <embed src="@codigo" width="100%" height="600px" />
                }
                else
                {
                    <label>No hay un archivo de programa asociado.</label>
                }
            }
        }
    }
}

@code {
    private string DocumentPath { get; set; } = "E:/D-13870.pdf";

    [Inject] protected CustomHttpClient Http { get; set; }

    protected List<Solution> rutas;

    string docPath;

    [Parameter]
    public string codigo { get; set; }

    [Parameter]
    public string accion { get; set; }

    protected override async Task OnInitializedAsync()
    {
        rutas = await Http.GetFromJsonAsync<List<Solution>>("api/Solution");

        await base.OnInitializedAsync();
    }
}

In the controller of Solution i use a query that gives me the root for the folder. So if i pass the parameter RUTAOF the root would be:

ruta.VALORC + codigo.Substring(0, 7) + ".pdf"
or the same: D:/Arbros/20. Digital/Planos/D-12345.pdf

I tried showig the root to see if it is okey and it is, so that is not the problem. Obviously the pdf exists. Locally, in my pc, this works fine and shows me the pdf but when I deploy the project the pdf keeps loading like if it dont find the file that I am sure that exists. I dont know if you need more information, in that case please let me know. I looked also to the permissions to the folders of the server and in all of them i gave access to the IIS to all the permits so i dont know what more to do.

Thanks, Matias.


AA Akshaya Arivoli Syncfusion Team November 20, 2020 01:26 PM UTC

Hi Matias , 

Thank you for your update.  

Based on the provided details we suspect that the write access permission is denied so the exception is thrown. We have embedded the Pdfium rendering engine in our PDF Viewer for robust rendering, so Pdfium will be generated on runtime within your project location. So kindly provide read and write access to your project location.  Also ensure whether the provided document is available in the published folder and provide the details if any error occurred in the network tab.       
     
Note:     
     
If you are publishing in Linux, kindly use Syncfusion.Blazor.PdfViewerServer.Linux  package in your application. Also, ensure whether the library dependencies of libpdfium.so are installed properly. Also, avoid installing both Windows and Linux packages in the same project. If not, please execute the following command to install the dependencies     
   
RUN apt-get update \         
    && apt-get install -y --allow-unauthenticated \         
        libc6-dev \         
        libgdiplus \         
        libx11-dev \         
        curl \         
        vim \         
        supervisor \         
        procps         
     
   
   

Kindly try it and revert us with more details if you have any concerns. This will be helpful for us to investigate further and assist you better.  

Regards, 
Akshaya  



Marked as answer

MM Matias Mutz November 20, 2020 09:17 PM UTC

Hi Akshaya,

Thanks for your reply. I gave the permissions that you told me and now the project is working perfect.

Best regards, Matias.


AA Akshaya Arivoli Syncfusion Team November 23, 2020 07:42 AM UTC

Hi Matias , 

Thank you for your update. We are glad to know that the reported issue is resolved.  Please contact us if you need any assistance in future. 

Regards, 
Akshaya  



DS Dieter Stapelberg June 14, 2022 02:11 PM UTC

Hello all, just FYI update. This thread put me on track to solve this spinning load icon when I take my app from dev to production.

I am running Blazor SfPdfViewerServer on .Net Core 3.1 app with IIS on Win Server 2022. Had this same spinning icon, soon as I published. I just had to give my application pool identity write access to my Application folder on the IIS Server. See the attached screenshot. You just need to look for the security account named the same as your application pool (EIT_Drawings in my case), see below:


Last note - thanks for a great product Syncfusion. Your tutorials combined with your forums are fantastic. It's appreciated, please keep it up.

2022-06-14 EIT_Drawings folder permissions to render PDF on Prod.png



VS Vasugi Sivajothi Syncfusion Team June 16, 2022 02:58 PM UTC

Hi Dieter,


Thank you for the update. Please let us know if you need any further assistance.


Regards,

Vasugi.



DM Dennis M replied to Akshaya Arivoli October 18, 2022 11:48 PM UTC

Hi Syncfusion team,

I also had the same problem with the infinite spinning load icon when deployed to IIS.

Quote from Akshaya above:

"We have embedded the Pdfium rendering engine in our PDF Viewer for robust rendering, so Pdfium will be generated on runtime within your project location. So kindly provide read and write access to your project location."

In a production environment, I do not want to grant write permissions for the account running the IIS application pool and I believe this would be a security issue. For instance, if the application were to be compromised in an attack, the attacker could change files or write files into the application directory for execution and that could be a big problem.

I see at runtime there is a directory named x64 gets created and that contains the file pdfium.dll

I would like to deploy all of the required files at deploy time without the need to grant write permissions in order for the application to write the Pdfium files at runtime.

Could the Syncfusion.Blazor.PdfViewerServer.Windows NuGet package be altered accordingly to include pdfium.dll in so that it does not need to be generated at runtime? 


Regards,

Dennis



VV Visvesvar Venkatesan Syncfusion Team October 19, 2022 05:18 PM UTC

Hi Dennis,


We have the plan to include the Pdfium within the PDFViewer to avoid such issues. But due to the package size, we are avoiding this. 


However, We will provide feedback regarding the reported issue tomorrow.



Regards,

Visvesvar K V 



VV Visvesvar Venkatesan Syncfusion Team October 20, 2022 01:33 PM UTC

Hi Dennis,


Kindly find the feedback below for the reported issue.  we don’t have any immediate plans to implement it now.  However, It will be implemented in any of our upcoming volume releases. 


Feedback :  PDFIUM must be integrated in to the PDF Viewer | Feature Feedback


Regards,

Visvesvar K V



DM Dennis M replied to Visvesvar Venkatesan October 21, 2022 06:05 AM UTC

Hi Visvesvar,

Thanks for adding the feedback item. However, I am concerned that there is no immediate plan to implement a fix if the requirement poses the security risk I have identified. 

Are you able to provide any workaround solutions that we could use to avoid giving the application write access to the application files? Would it be okay if we manually deploy the x64 directory including the file pdfium.dll ?

Regards,

Dennis



VV Visvesvar Venkatesan Syncfusion Team October 24, 2022 05:04 AM UTC

Hi Dennis,


Thank you for your update.


We are analyzing your reported query and we will update further details on 26 Oct, 2022.


Regards,

Visvesvar K V 



VV Visvesvar Venkatesan Syncfusion Team October 26, 2022 01:26 PM UTC

Hi Dennis,


Thank you for your patience.


As we already mentioned we don’t have support to include pdfium.dll with our PDF Viewer, Also we could not provide any workaround solution to include the pdfium along with PDF Viewer.


As of now, you could deploy the pdfium dll manually. We will update once the feature has been implemented.



Regards,

Visvesvar K V 



DM Dennis M October 27, 2022 04:49 AM UTC

Hi Visvesvar,

Thanks for the update. I will try to deploy pdfium.dll manually and report back for anyone following.

Can you please advise what happens now. Is pdfium.dll embedded in one of your dll files and then extracted at runtime, or is it downloaded at runtime? 

Regards,

Dennis



VV Visvesvar Venkatesan Syncfusion Team October 27, 2022 02:00 PM UTC

Hi Dennis,


Thank you for your update. Kindly check and revert to us.


If pdfium.dll is embedded in one of your dll files it will get extracted dynamically and it will not get downloaded.



Regards,

Visvesvar K V


Loader.
Up arrow icon