facebooktwittermenuarrow-up

GemBox Support Forum

SpreadsheetInfo.SetLicense

Hello,
I have updated gembox version from 45.0.0.1043 to 45.0.1187. In my startup, i used to set license key like this:

after the update when i start project some dlls are missing:


ReachFramework,
PresentationCore,
PresentationFramework,
System.Windows.Freezable.

Though there was an error when downloading nugget dependencies. found them and written separately but didn’t work out.

I haven’t found any related issues so any advice is appreciated.
my application: .NET core 3.1

Hi,

Please provide the stack trace of the exception so we can see what GemBox.Spreadsheet functionality you used when exception was thrown.

Is your application running on Windows or on some other operating system?

Regards,
Stipo

at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeAssembly.get_DefinedTypes()
at AutoMapper.ServiceCollectionExtensions.<>c.b__14_2(Assembly a)
at System.Linq.Enumerable.SelectManySingleSelectorIterator2.ToArray() at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source)
at AutoMapper.ServiceCollectionExtensions.AddAutoMapperClasses(IServiceCollection services, Action2 configAction, IEnumerable1 assembliesToScan)
at AutoMapper.ServiceCollectionExtensions.AddAutoMapper(IServiceCollection services, Action2 configAction, Assembly[] assemblies) at AutoMapper.ServiceCollectionExtensions.AddAutoMapper(IServiceCollection services) at Tvs.FileExportService.Startup.ConfigureServices(IServiceCollection services) in C:\Users\Egis\Documents\projects\file-export-service\tvs-fileexportservice\Hosting\Startup.cs:line 39 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.StartupLoader.ConfigureServicesDelegateBuilder1.<>c__DisplayClass15_0.g__RunPipeline|0(IServiceCollection services)
at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection services)
at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass8_0.b__0(IServiceCollection services)
at Microsoft.AspNetCore.Hosting.StartupLoader.ConfigureServicesDelegateBuilder`1.<>c__DisplayClass14_0.g__ConfigureServicesWithContainerConfiguration|0(IServiceCollection services)
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
at Microsoft.AspNetCore.Hosting.WebHost.EnsureApplicationServices()
at Microsoft.AspNetCore.Hosting.WebHost.Initialize()
at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
at Tvs.FileExportService.Program.Main(String[] args) in C:\Users\Egis\Documents\projects\file-export-service\tvs-fileexportservice\Hosting\Program.cs:line 15

I’m using Windows.

Hi,

It seems to me that the issue is originating from AutoMapper that uses reflection to also inspect all GemBox.Spreadsheet types. Some GemBox.Spreadsheet types have a dependency on WPF so probably cannot be loaded by the .NET runtime if WPF assemblies cannot be loaded.

Is it possible to exclude inspection of GemBox.Spreadsheet assembly by AutoMapper?

Regards,
Stipo

Hi,
The problem was with AutoMapper.Extensions.Microsoft.DependecyInjection nugget. if this one is removed from the project, everything works. but you have to write all mappings, because as you said it uses reflection to inspect all object types and properties. Thank you for your time :slight_smile: