-
-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
Hi,
i've following issue with dapper after Publishing my software as AOT:
'Dapper.SqlMapper+TypeHandlerCache' 1[System.Guid]' is missing native code or metadata. This can happen for code that is not compatible with trimming or AOT. Inspect and fix trimming and AOT related warnings that were generated when the app was published. For more information see
https://aka.ms/nativeaot-compatibility
Already added an Handler for GUID:
public sealed class GuidAsStringHandler : SqlMapper.TypeHandler<Guid>
{
public override void SetValue(IDbDataParameter parameter, Guid value)
=> parameter.Value = value.ToString();
public override Guid Parse(object value) => value switch
{
string s => Guid.Parse(s),
byte[] b => new Guid(b),
_ => Guid.Parse(Convert.ToString(value)!)
};
}I didn't see any warning about this while building
Can you give me an advice on this?
Metadata
Metadata
Assignees
Labels
No labels