Handler Cpl Edward Kingsland said the importance of the visit could not be overestimated.
"The Princess Royal has taken a real interest in our work and experiences.
"I am personally delighted that the dog unit is getting the recognition it deserves. It will be the same for all of those units who don't necessarily make it into the headlines."
Princess Anne holds the same rank with the Royal Logistic Corps, and so visited its Close Support Logistic Regiment.
She then spoke to soldiers of the Queen's Own Gurkha Logistics Regiment, 9 Regimental Royal Logistic Corps, the Household Cavalry Regiment and 205 (Scottish) Field Hospital at Camp Bastion.
The camp is situated northwest of Lashkar Gah, the capital of Helmand province.
Later, the princess visited neighbouring Kandahar province to see the Joint Force Communication and Information Systems Head Quarters and speak to members of the RAF Lyneham Detachment.
She also met soldiers at the Canadian Forces Compound.
The princess's last visit to Afghanistan was in October 2006.
'We will remember him'
The soldier from A Company 4 Rifles has not yet been named.
Lt Col David Wakefield, spokesman for Task Force Helmand, said: "The patrol he was on was part of ongoing operations by the 3 Rifles Battle Group to expand the area of security around the district centre, when he was shot and killed by small arms fire.
"He died doing his duty, boldly confronting the enemy; we will remember him."
The MoD says his death was not connected to Operation Moshtarak, the Nato offensive in southern Afghanistan.
In this operation, thousands of US, British and Afghan soldiers are pushing to clear Taliban forces from Marjah and Nad Ali, in the southern province of Helmand.
British troops have been in Afghanistan since 2001.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.