I am using the vanilla library of keepass simply by adding the .exe file to my project. From my code I am accessing PwDatabase like so:
var dbpath = @"\\MyPath\To\PersonalVault\PersonalVault.kdbx";
var masterpw = "myPassword";
var ioConnInfo = new IOConnectionInfo { Path = dbpath };
var compKey = new CompositeKey();
compKey.AddUserKey(new KcpPassword(masterpw));
var db = new KeePassLib.PwDatabase();
db.Open(ioConnInfo, compKey, null);
From there I want to access and read the custom string field that I have previously manually added from the Advanced tab of entry on the UI:
var entry = db.RootGroup.FindEntry(new KeePassLib.PwUuid(KeePassLib.Utility.MemUtil.HexStringToByteArray("97A51FE92F700D4FB665DC6AA7C9D67D")), true);
var customString = entry.Strings.Where(lookingFor => lookingFor.Key.Equals("customString")).FirstOrDefault().Value;
However I end up with a null value here.
Any suggestion on how I can read this or is it simply not exposed through the vanilla KeePass.exe?