Could not load file or assembly 'Stimulsoft.Report

Stimulsoft Reports.NET discussion
Post Reply
AlharbiN
Posts: 32
Joined: Wed Jan 02, 2013 1:07 pm

Could not load file or assembly 'Stimulsoft.Report

Post by AlharbiN »

Hi,
I'm trying to render my report by getting the report from its assembly using the code below.

p.s: the code is invoked within the MvcApplication class

Code: Select all


public class MvcApplication : System.Web.HttpApplication
 {

...

        private async Task printCertificate(string data, long chatid, string caption)
        {

...

            StiReport report = null;
            try
            {
                if(System.IO.File.Exists(sFullFileName))
                {
                    report = StiReport.GetReportFromAssembly(sFullFileName);
                    report.Render(false);

                }
            }
            catch (Exception e)
            {
                string s = e.Message;
            }
            
...

	}

...

}

But I got this error!

Error Message=>
--------
Could not load file or assembly 'Stimulsoft.Report, Version=2020.5.1.0, Culture=neutral, PublicKeyToken=ebe6666cba19647a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
--------

Stack Trace=>
-------
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at Stimulsoft.Report.StiReport.GetReportsFromAssembly(Assembly assembly) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\StiReport.SaveLoad.cs:line 648
at Stimulsoft.Report.StiReport.GetReportFromAssembly(Stream assemblyStream) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\StiReport.SaveLoad.cs:line 754
at Stimulsoft.Report.StiReport.GetReportFromAssembly(String assemblyFile, Boolean lockFile) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\StiReport.SaveLoad.cs:line 723
at Stimulsoft.Report.StiReport.GetReportFromAssembly(String assemblyFile) in D:\Stimulsoft\Stimulsoft.Reports\Stimulsoft.Report\StiReport.SaveLoad.cs:line 683
at Logistics.MvcApplication.<printCertificate>d__10.MoveNext() in D:\Projects\WebinarProject\Webinars\Logistics\Global.asax.cs:line 234
-------

FusionLog=>
=== Pre-bind state information ===
LOG: DisplayName = Stimulsoft.Report, Version=2020.5.1.0, Culture=neutral, PublicKeyToken=ebe6666cba19647a
(Fully-specified)
LOG: Appbase = file:///D:/Projects/WebinarProject/Webinars/Logistics/
LOG: Initial PrivatePath = D:\Projects\WebinarProject\Webinars\Logistics\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: D:\Projects\WebinarProject\Webinars\Logistics\web.config
LOG: Using host configuration file: C:\Users\USER\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Stimulsoft.Report, Version=2020.5.1.0, Culture=neutral, PublicKeyToken=ebe6666cba19647a
LOG: Attempting download of new URL file:///C:/Users/USER/AppData/Local/Temp/Temporary ASP.NET Files/vs/322b9840/5d276d11/Stimulsoft.Report.DLL.
LOG: Attempting download of new URL file:///C:/Users/USER/AppData/Local/Temp/Temporary ASP.NET Files/vs/322b9840/5d276d11/Stimulsoft.Report/Stimulsoft.Report.DLL.
LOG: Attempting download of new URL file:///D:/Projects/WebinarProject/Webinars/Logistics/bin/Stimulsoft.Report.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Build Number
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

Can you help, please?
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Could not load file or assembly 'Stimulsoft.Report

Post by HighAley »

Hello,

It seems that the report assembly is compiled by another version of our tool.
You should load them in the same version where is was compiled.

Thank you.
AlharbiN
Posts: 32
Joined: Wed Jan 02, 2013 1:07 pm

Re: Could not load file or assembly 'Stimulsoft.Report

Post by AlharbiN »

Thank you very much,
Yes, that was the problem, and now it works!
Andrew
Posts: 4104
Joined: Fri Jun 09, 2006 3:58 am

Re: Could not load file or assembly 'Stimulsoft.Report

Post by Andrew »

Okay, great!
Post Reply