I wanted to write a post about this cache corruption issue, as it occurs in a particular set of circumstances that seems to be quite common across the internet.
When does the issue occur?
Dynamics AX installs a Visual Studio 2010 shell to use TFVC version control through either TFS (now: Azure DevOps Server) or Azure DevOps.
While the integration into Dynamics AX is seemless, Visual Studios version control engine is used in the background to check files in and out and Dynamics AX builds a cache based on the items in source control.
When using newer versions of TFVC the version control cache can get corrupted which results in the error TF237121. This is usually accompanied by the message “Cannot complete the operation. An unexpected error occurred.”
Why does the issue occur?
Dynamics AX 2012 (all rollup versions) installs the Visual Studio 2010 shell upon its installation and uses this to communicate with the version control server.
Because AX gets bundled with a particular version of Visual Studio, Visual Studio is not always as up-to-date as it can be.
This means that sometimes it can struggle to complete version control transactions with newer versions of TFVC (in either TFS or Azure DevOps) correctly. This corrupts AX’s version control cache.
What is the short term fix for this?
You can delete the version control cache, which will mean that AX will rebuild the cache from scratch, likely avoiding the error for a while.
The version control cache is usually located at: C:\Users[Your User]\AppData\Local\Microsoft\Team Foundation\3.0\Cache
Is there a long term fix?
You should install the latest updates for Visual Studio 2010 as soon as you can.
After this you need to delete the version control cache to allow the newer version of Visual Studio (under instruction of AX) to rebuild the cache.
If you have not got service pack 1 installed, you can find it here.
Once you have Service Pack 1 installed, you should use Windows Update to install all the latest Visual Studio updates. For this issue in particular you will require KB2938807. This can also be downloaded separately.