Here is a demo for your reference:
static void Main(string[] args)
{
string siteCollectionUrl = "https://tenantname.sharepoint.com/sites/sitename";
string userName = "[email protected]";
string password = "yourpassword";
// Namespace: Microsoft.SharePoint.Client
ClientContext ctx = new ClientContext(siteCollectionUrl);
// Namespace: System.Security
SecureString secureString = new SecureString();
password.ToList().ForEach(secureString.AppendChar);
// Namespace: Microsoft.SharePoint.Client
ctx.Credentials = new SharePointOnlineCredentials(userName, secureString);
// Namespace: Microsoft.SharePoint.Client
Site site = ctx.Site;
ctx.Load(site);
ctx.ExecuteQuery();
Web web = ctx.Web;
ctx.Load(web,w => w.ServerRelativeUrl,w => w.Lists);
List list = web.Lists.GetByTitle("List1");
ctx.Load(list);
CamlQuery camlQuery = new CamlQuery();
ListItemCollection itemColl = list.GetItems(camlQuery);
ctx.Load(itemColl);
ctx.ExecuteQuery();
foreach (ListItem item in itemColl)
{
Console.WriteLine(item["Title"].ToString());
ListItemVersionCollection itemversioncollection = item.Versions;
ctx.Load(itemversioncollection);
ctx.ExecuteQuery();
for (int iVersionCount = 0; iVersionCount < itemversioncollection.Count; iVersionCount++)
{
ListItemVersion version = itemversioncollection[iVersionCount];
Console.WriteLine(version.FieldValues["Title"].ToString());
}
}
}
And for version object, you can access like version.FieldValues["fieldname"], you can check the field name in Visual Studio like below: