Error MSB4018: The "SqlBuildTask" task failed unexpectedly. Microsoft.Isam.Esent.Interop.EsentVersionStoreOutOfMemoryException:
A customer contacted me about a problem on their build servers. The build for one of their applications failed sometimes with the following error message:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(550,5): Error MSB4018: The "SqlBuildTask" task failed unexpectedly. Microsoft.Isam.Esent.Interop.EsentVersionStoreOutOfMemoryException: Version store out of memory (cleanup already attempted) at Microsoft.Isam.Esent.Interop.Api.Check(Int32 err)
The solution contained a SQL Server Database project, that resulted in the error above. When we removed the database project from the build configuration, the error disappeared.
Further investigation brought us to a final solution; an update of the SQL Server Data Tools on the Build server solved the problem.