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>