Get SecRecord work on macOS
Hi!
I'm trying to use SecRecord class with Xamarin for macOS.
When the app is running, I always get the Exception:
System.ArgumentNullException
Value cannot be null
Parameter name: obj
The callstack is:
<myMethod>
Security.SecRecord..ctor()
Foundation.NSMutableDictionary..ctor()
Foundation.NSDictionary..ctor
Foundation.NSObject..ctor
Foundation.NSObject.AllocIfNeeded()
ObjCRuntime.Class.GetHandle() Class.cs:134
ObjCRuntime.Class.GetClassHandle Class.cs : 181
ObjCRuntime.Class.GetClassHandle() Class.cs :151
My code looks like in example from site:
var queryRec = new SecRecord(SecKind.GenericPassword)
{
Service = "123",
Account = "1234",
};
but I've checked, it occures with any SecRecord construction.
This issue is not new, someone met it before: https://stackoverflow.com/questions/50936376/net-core-c-sharp-macos-keychain-api
But he did not find the answer.
What could I do to fix this?