ASP.net - An error has occurred when trying to initialize jsreport



  • I'm far less qualified than Jan to comment, but I'll give a few thoughts! If you error message is "Access is denied", then I would first try running the project as administrator. If that doesn't work, go to every place that jsreports will be accessing (temp folder, folder where you store templates, etc) and make sure the security allows access. If you're using IIS, then you'll have to grant full control to "IUSR" and "IIS_IUSRS"



  • Hi great help incredible. But things went the other way around.
    I can run the project irrespective of modes(admin/standard user), now i'm getting an error from the antivirus(Avast Free Ware) that i have installed on my workstation. But however if i unchecked the Checkbox to (Scan programs when executing, it's an option in the Avast antivirus dashbord) the code works like a charm.

    What I don't understand is that is it good practice to disable "Scan programs when executing," option in the antivirus. Coz when i disable the option, i can run the poc effortlessly. Vice versa is leading to a malware Detect error, avast antivirus recognizing .jsReport.exe as some maleware and removing it after clicking yes to remove.

    Also now im getting a popup saying its been submitted to Avast Lab, and soon will be hearing about it.



  • When i'm adding the jsReport.exe as a trusted file the code works great, seems like some issue on jsReport.exe thing.



  • Is there any way to put this whole observation into some mspaint file or somewhere so that everybody will get the idea.



  • Adding to above issue, observation made while running the project with admin mode, and trying to give jsReport.exe the admin permission i'm getting Windows defender smartscreen alert saying Windows Defender

    Windows protected your PC
    Windows Defender SmartScreen prevented an unrecognized app from starting. Running this app might put your PC at risk.

    App:
    jsreport.exe
    Publisher:
    Unknown publisher

    And i'm not able to give the jsreport.exe admin permission.


  • administrators

    Is there any way to put this whole observation into some mspaint file or somewhere so that everybody will get the idea.

    click the "Reply" button, and then drag and drop an image in the box that has the "compose" text

    0_1521046410607_Captura de pantalla 2018-03-14 a las 11.52.37 a.m..png



  • After adding the path of jsreport.exe in the exclusion category inside Avast antivirus console, and removing below two codes i'm able to generate the reports.

    var rs = new LocalReporting()
    //.RunInDirectory(runExePath)
    .KillRunningJsReportProcesses()
    //.Configure(cfg => cfg.AllowLocalFilesAccess().FileSystemStore().BaseUrlAsWorkingDirectory())
    .UseBinary(JsReportBinary.GetBinary()).AsUtility().Create();

    Still i want to know why avast and windows defender behaves like this?



  • That's a great question. My guess is that avast and windows defender don't like seeing random executables being started seemingly out of the blue, and not many users with them have added them as exclusions to the database. It's probably just a growing pain of sort for JSreports.

    Keep in mind, that's my guess as a user, not a developer or anything.



  • Observations

    Running the project in admin mode.

    Code shot:-

    0_1521046902191_upload-5ba4b6f7-1e03-42ae-b8ed-510ee4595279

    Avast Antivirus:-

    0_1521046976006_upload-516125c1-65a6-4ee9-8702-b5bea1387607

    Conclusion:-

    I'm able to download the Pdf file generated from the HTML contents.

    Removing Exclusion from Avast antivirus:-
    0_1521047233930_upload-238a39f9-7cf5-496b-96e5-f9977cd1961b

    Running the Application and the observation :-

    0_1521047460039_upload-d9c72933-45ab-43ac-8ad4-05bc14a0f996

    Above are all my observations.


  • administrators

    as @tyler-shuhnicki has said i think all of this is just the result of antivirus being defensive by default (the same for windows defender), of course jsreport.exe is not a malware or something dangerous but antivirus says that because it doesn't know what it is so the best default for the antivirus is to block the executable and ask you (the user) to allow the executable explicitly. there should be a way to allow the executable in windows defender too.

    btw i think all of this is caused by having

    Publisher: Unknown publisher

    maybe we can find a way to fill this "publisher" information so maybe it can help the executable to not be detected as something dangerous, in the mean time just allow the executable explicitly in your antivirus and windows defender rules.


  • administrators

    and just for the record, every software in the world at some point has to deal with incorrect antivirus reports so i think the easy workaround for now is to configure them to always allow the jsreport.exe 😄



  • Great response, keep the good work up.These were just some bunch of random observations while doing the POC. Thank you all again.


  • administrators

    @explorer855 thanks for sharing your case, it is good to know new kind of problems that users can face.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.