Error Could not load file or assembly

Is anyone familiar with this error I am receiving?

Could not load file or assembly “zx_1bed7bf046084828950439f5cfb89bf9”

I have an existing .NET 3.5 console application that successfully uses Aspose.Words (14.4.0.0) and I am trying to include Aspose.Cells (8.0.2.0) into the project. Whenever I make use of anything in the Aspose.Cells namespace I get this error. This includes trying to call something as simple as SetLicense or Workbook wb = new Workbook();

I’m using an Aspose.Total licence if that matters. Any insight would be greatly appreciated.

Message:
Could not load file or assembly ‘zx_1bed7bf046084828950439f5cfb89bf9, PublicKeyToken=716fcc553a201e56’ or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

InnerException:
String cannot have zero length.

StackTrace:
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at ​ ..()
at ​ .(Object , ResolveEventArgs )
at System.AppDomain.OnResourceResolveEvent(String resourceName)
at System.Reflection.Assembly._GetResource(String resourceName, UInt64& length, StackCrawlMark& stackMark, Boolean skipSecurityCheck)
at System.Reflection.Assembly.GetResource(String resourceName, UInt64& length, StackCrawlMark& stackMark, Boolean skipSecurityCheck)
at System.Reflection.Assembly.GetManifestResourceStream(String name, StackCrawlMark& stackMark, Boolean skipSecurityCheck)
at System.Reflection.Assembly.GetManifestResourceStream(String name)
at .(String )
at . ()
at .()
at …ctor(StringBuilder )
at . ()
at .( , )
at .( )
at .(Stream )
at .(String , Assembly )
at Aspose.Cells.License.SetLicense(String licenseName)
at ConsoleApplication1.Business.ReportBuilder.InitLicense() in C:\Users\user-name\Documents\TFS\ConsoleApplication1\Business\Reports\ReportBuilder.cs:line 4574
at ConsoleApplication1.Business.ReportBuilder.InitDocumentTemplate(SearchXML search) in C:\Users\user-name\Documents\TFS\ConsoleApplication1\Business\Reports\ReportBuilder.cs:line 66
at ConsoleApplication1.Business.Reports.ReportDirector.MakeReport(ReportBuilder builder, SearchXML search) in C:\Users\user-name\Documents\TFS\ConsoleApplication1\Business\Reports\ReportDirector.cs:line 13
at ConsoleApplication1.Program.BuildDocument(Int32 searchId) in C:\Users\user-name\Documents\TFS\ConsoleApplication1\Program.cs:line 263
at ConsoleApplication1.Program.Main(String[] args) in C:\Users\user-name\Documents\TFS\ConsoleApplication1\Program.cs:line 97

StackTrace:
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at ​ ..()
at ​ .(Object , ResolveEventArgs )
at System.AppDomain.OnResourceResolveEvent(String resourceName)
at System.Reflection.Assembly._GetResource(String resourceName, UInt64& length, StackCrawlMark& stackMark, Boolean skipSecurityCheck)
at System.Reflection.Assembly.GetResource(String resourceName, UInt64& length, StackCrawlMark& stackMark, Boolean skipSecurityCheck)
at System.Reflection.Assembly.GetManifestResourceStream(String name, StackCrawlMark& stackMark, Boolean skipSecurityCheck)
at System.Reflection.Assembly.GetManifestResourceStream(String name)
at ​ .(String )
at . ()
at …ctor(Boolean )
at Aspose.Cells.WorkbookSettings…ctor(Workbook , CountryCode )
at Aspose.Cells.Workbook.(String , LoadOptions )
at Aspose.Cells.Workbook…ctor(String file)
at ConsoleApplication1.Business.AsposeStyleChart.LoadAsposeStyleChart(DataTable dt, String fileName) in C:\Users\user-name\Documents\TFS\ConsoleApplication1\AsposeStyleChart.cs:line 23
at ConsoleApplication1.Business.ReportBuilder.GenerateSRPATiltChart(String universeId, String perfDt, ProductXFerList products, ProductXFerList benchmarks, CalcPeriodsXfer periods, RPOptions options) in C:\Users\user-name\Documents\TFS\ConsoleApplication1\Business\Reports\ReportBuilder.cs:line 5697
at ConsoleApplication1.Business.ReportBuilder.BuildCharts() in C:\Users\user-name\Documents\TFS\ConsoleApplication1\Business\Reports\ReportBuilder.cs:line 4961
at ConsoleApplication1.Business.ReportBuilder.InitDocumentTemplate(SearchXML search) in C:\Users\user-name\Documents\TFS\ConsoleApplication1\Business\Reports\ReportBuilder.cs:line 67
at ConsoleApplication1.Business.Reports.ReportDirector.MakeReport(ReportBuilder builder, SearchXML search) in C:\Users\user-name\Documents\TFS\ConsoleApplication1\Business\Reports\ReportDirector.cs:line 13
at ConsoleApplication1.Program.BuildDocument(Int32 searchId) in C:\Users\user-name\Documents\TFS\ConsoleApplication1\Program.cs:line 263
at ConsoleApplication1.Program.Main(String[] args) in C:\Users\user-name\Documents\TFS\ConsoleApplication1\Program.cs:line 97

@Tom343,

Thanks for using Aspose APIs.

It seems, you are using Reflection APIs to load the assembly. If you are adding reference to assembly in a normal way, then please remove the old reference and add the new one. And then clean and rebuild.

In any case, you should clean and rebuild your solution whether you are adding the Aspose.Cells.dll reference first time or second or third time etc.

If you are unable to resolve this issue, please provide us some simple console application project that we could use to replicate the issue at our end.

We also recommend you to try the most recent version and see if it makes any difference and resolves your issue.

You can download the most recent version from the following link.

1 Like

Thanks for the feedback Shakeel! After upgrading to the latest version available with my license (Cells 8.2.2) the issue seems to have been resolved.

@Tom343

Thanks for using Aspose APIs.

It is good to know that your issue is resolved with the later version. Let us know if you encounter any other issue, we will be glad to look into it and help you further.