SSAS errors: Errors in the metadata manager. The dimension with ID of ‘xxx’ referenced by the ‘yyy’ cube, does not exist.

While working on an SSAS solution, my Visual Studio crashed. When I restarted it and tried to deploy database, it started giving me error:

After some bit of googling, came to the following article. SSAS errors: Errors in the metadata manager. The dimension with ID of ‘xxx’ referenced by the ‘yyy’ cube, does not exist.. Once I removed old database from database directory which is “$:\Program Files\Microsoft SQL Server\MSAS10_50.MSSQLSERVER\OLAP\Data” and restarted the Analysis Service on target instance, I was able to deploy the solution.