Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASP.net Core 3.0 Deployment - Could not load file or assembly jsReport.Local #48

Closed
iHamzaKhanzada opened this issue Apr 4, 2020 · 6 comments

Comments

@iHamzaKhanzada
Copy link

I am using ASP.net Core 3.0 and I wanted to have html to pdf export functionality, I found JSReport as a solution So I followed the Jon Blaha's Implementation of JSReport .net SDK to export html to pdf, I have successfully install nugets jsReport.Binary, jsReport.Local and jsReport.AspNetCore in my development machine.
Following are the dlls that got installed

  • jsReport.AspNetCore.dll (v2.0.2.0)
  • jsReport.Client.dll (v3.0.1.0)
  • jsReport.Local.dll (v2.2.2.0)
  • jsReport.Shared.dll (v2.1.0.0)
  • jsReport.Types.dll (v2.6.1.0)
  • jsReport.Binary.dll (v2.7.1.0)

I have followed the Jon Blaha's implementation and Export html to pdf working fine on my dev machine. But when I uploaded dlls with my project's published dll my application got stopped working

an error occurred while starting the application

I searched for this error and I found that I had to enable logging through my web.config by using

stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout"

to get the actual error message behind my startup failure.

After doing the required changes to my web.config and I got the log file generated, it says

System.IO.FileNotFoundException: Could not load file or assembly 'jsreport.Local, Version=2.2.2.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

crit: Microsoft.AspNetCore.Hosting.Diagnostics[6]
      Application startup exception
System.IO.FileNotFoundException: Could not load file or assembly 'jsreport.Local, Version=2.2.2.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'jsreport.Local, Version=2.2.2.0, Culture=neutral, PublicKeyToken=null'
   at Technicianspk.Startup.ConfigureServices(IServiceCollection services)
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass9_0.<Invoke>g__Startup|0(IServiceCollection serviceCollection)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass8_0.<Build>b__0(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.UseStartup(Type startupType, HostBuilderContext context, IServiceCollection services)
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass13_0.<UseStartup>b__2(IApplicationBuilder app)
   at Microsoft.AspNetCore.Server.IISIntegration.IISSetupFilter.<>c__DisplayClass4_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app)
   at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken)

I doubled check my wwwroot directory through FTP using FileZilla and I had all these required jsReport dlls on my server but still I am getting file not found.

I even compared the dll versions and made sure my .csproj file reference all the required jsreport dlls but still its unable to find jsReport.Local.dll.

I have jsReport.Local.dll in my dev machine and also in my server's wwwroot directory where all the other dlls are present including my project.dll and project.views.dll and project.exe etc.

My cs.proj file also has the following

<ItemGroup>
 <PackageReference Include="jsreport.AspNetCore" Version="2.0.2" />
 <PackageReference Include="jsreport.Binary" Version="2.7.1" />
 <PackageReference Include="jsreport.Client" Version="3.0.1" />
 <PackageReference Include="jsreport.Local" Version="2.2.2" />
 <PackageReference Include="jsreport.Shared" Version="2.1.0" />
 <PackageReference Include="jsreport.Types" Version="2.6.1" />
</ItemGroup>

I have also asked the same on StackOverflow

@pofider
Copy link
Contributor

pofider commented Apr 5, 2020

Please try to create just a hello world app. Does it work there?
Please upload somewhere your project and how the deployment output looks like.

I tried preparing a new asp.net core mvc 3 app. Referenced jsreport. Published to the folder and there is no issue when running the asp.net server through outputted exe.

@iHamzaKhanzada
Copy link
Author

Thankyou for the response Jan Blaha, can you please guide me to the documentation of publishing and uploading jsReport Aspnet core dll into server? I couldn’t find the uploading on live server documentation. And what do you mean by running aspnet core server through outputted.exe?

@pofider
Copy link
Contributor

pofider commented Apr 5, 2020

Thankyou for the response Jan Blaha, can you please guide me to the documentation of publishing and uploading jsReport Aspnet core dll into server?

There is nothing special. You usually just publish it like any other app.

And what do you mean by running aspnet core server through outputted.exe?

The VS publish modal with "Foldeprofile" by default outputs folder with the exe file you can run which starts the web app inside console.

@iHamzaKhanzada
Copy link
Author

Are you talking about the Kestrel Server? My app is published using IIS windows 64bit. I have web.config file generated by the publish and it runs on IIS

@iHamzaKhanzada
Copy link
Author

Thankyou so much Jan for the suggestion of trying with

just a hello world app. Does it work there?

There was some problems with permissions and some problem with uploading. I have fixed my issue now. Thankyou so much for the support

@zanyar3
Copy link

zanyar3 commented Sep 22, 2021

Thankyou so much Jan for the suggestion of trying with

just a hello world app. Does it work there?

There was some problems with permissions and some problem with uploading. I have fixed my issue now. Thankyou so much for the support

Hi

Please Attaches here, set permissions which file and folder ? I have some issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants