Skip to content

.Net Core 3 Issue #60

@Dieder

Description

@Dieder

I have installed the latest NuGet package of your library with version 2.1.0-rc.
Unfortunately it doesn't work at runtime.
After execution, I get the following error:
System.AggregateException : One or more errors occurred. (The type initializer for 'ExpressionBuilder.Helpers.OperationHelper' threw an exception.)
---- System.TypeInitializationException : The type initializer for 'ExpressionBuilder.Helpers.OperationHelper' threw an exception.
-------- System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types.

The cause of the problem is found in the file ' OperationHelper.cs' operation 'LoadDefaultOperations' . I don't know why all assemblies have to be loaded with all types, but this implementation causes the error. I made a fix in the implementation of the method as follows:
var @interface = typeof(IOperation);
var operationsFound = typeof(IOperation).Assembly
.GetTypes()
.Where(p => @interface.IsAssignableFrom(p) && p.IsClass && !p.IsAbstract)
.Select(t => (IOperation)Activator.CreateInstance(t));

This will fix the issue. Furthermore the compile conditions are missing the new core 3.0 and 3.1 compiler variables.

Please, will you update the code, so it works with .Net Core 3.0? Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions