You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code throws an exception MissingMethodException
using System;
using Nelibur.ObjectMapper;
namespace ConsoleApp9
{
class Program
{
static void Main(string[] args)
{
var location = new Location("A", "C:\\", Guid.NewGuid());
TinyMapper.Bind<Location, LocationDto.Standard>();
var dto = TinyMapper.Map<LocationDto.Standard>(location);
Console.WriteLine("Hello World!");
}
}
public class Location
{
public Guid Id { get; private set; }
public string Name { get; private set; }
public string Path { get; private set; }
public Guid CreatedByUserId { get; private set; }
public DateTime CreationDateTime { get; private set; }
public Location(string name, string path, Guid createdByUserId)
{
Id = Guid.NewGuid();
Name = name;
Path = path;
CreatedByUserId = createdByUserId;
CreationDateTime = DateTime.UtcNow;
}
}
public class LocationDto
{
public class New
{
public string Name { get; set; }
public string Path { get; set; }
}
public class Standard : New
{
public Guid Id { get; set; }
public Guid CreatedByUserId { get; set; }
public DateTime CreationDateTime { get; set; }
public Standard()
{
}
}
}
}
Exception Deails:
System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'Nelibur.ObjectMapper.TinyMapper' threw an exception.
Source=TinyMapper
StackTrace:
at Nelibur.ObjectMapper.TinyMapper.BindTSource,TTarget
at ConsoleApp9.Program.Main(String[] args) in C:\Users\amahmood\source\repos\ConsoleApp9\Program.cs:line 11
Inner Exception 1:
TypeInitializationException: The type initializer for 'Nelibur.ObjectMapper.Reflection.DynamicAssemblyBuilder' threw an exception.
Inner Exception 2:
MissingMethodException: Method not found: 'System.Reflection.Emit.AssemblyBuilder System.AppDomain.DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess)'.
The following code throws an exception MissingMethodException
Exception Deails:
System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for 'Nelibur.ObjectMapper.TinyMapper' threw an exception.
Source=TinyMapper
StackTrace:
at Nelibur.ObjectMapper.TinyMapper.BindTSource,TTarget
at ConsoleApp9.Program.Main(String[] args) in C:\Users\amahmood\source\repos\ConsoleApp9\Program.cs:line 11
Inner Exception 1:
TypeInitializationException: The type initializer for 'Nelibur.ObjectMapper.Reflection.DynamicAssemblyBuilder' threw an exception.
Inner Exception 2:
MissingMethodException: Method not found: 'System.Reflection.Emit.AssemblyBuilder System.AppDomain.DefineDynamicAssembly(System.Reflection.AssemblyName, System.Reflection.Emit.AssemblyBuilderAccess)'.
CSPROJ Content
BTW, I initially thought that it failed because it needs a default constructor on the target type but it still failed.
The text was updated successfully, but these errors were encountered: