Just trying 4.5.0 with simple examples, and getting a null exception when using AutoMapping.
Created a .net core web project, added ServiceStack.Text 4.5.0, and these:
public class A
{
public int Id { get; set; }
}
public class B
{
public int Id { get; set; }
}
then right at the start:
new B().PopulateWithNonDefaultValues(new A());
throws
System.NullReferenceException was unhandled by user code
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=ServiceStack.Text
StackTrace:
at ServiceStack.PropertyInvoker.GetPropertyGetterFn(PropertyInfo propertyInfo)
at ServiceStack.AssignmentMember.GetGetValueFn()
at ServiceStack.AssignmentEntry…ctor(String name, AssignmentMember from, AssignmentMember to)
at ServiceStack.AssignmentDefinition.AddMatch(String name, AssignmentMember readMember, AssignmentMember writeMember)
at ServiceStack.AutoMappingUtils.<>c__DisplayClass15_0.b__0(String )
at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func
2 valueFactory)
at ServiceStack.AutoMappingUtils.GetAssignmentDefinition(Type toType, Type fromType)
at ServiceStack.AutoMappingUtils.PopulateWithNonDefaultValues[To,From](To to, From from)
at WebApplication1.Startup.ConfigureServices(IServiceCollection services) in Startup.cs:line 21
InnerException:
Is there initialisation or some other dependencies I’ve missed?