Cannot Access a Disposed Object – ModelStore

If you use the database schema compare tool in Visual Studio 2012 you may see the following error when trying to compare the database with the source:

Cannot access a disposed object. Object name: ‘ModelStore’

For me, this was arose after installing the June 2013 update 3 for Visual Studio 2012.

I resolved the error by running Clean Solution and rebooting my machine.

Hopefully this helps someone, as the error isn’t exactly helpful 🙂

This entry was posted in Visual Studio and tagged , . Bookmark the permalink.

2 Responses to Cannot Access a Disposed Object – ModelStore

  1. Will says:

    I encountered this exact situation and couldn’t figure out what to do, so thanks for the write up! It’s amazing how often I forget to try turning it off and turning it on again.

  2. Alejandro says:


    I also encountered the same problem with VS2013.
    It worked for me just with restarting VS and SQL Server services.

    Hope it helps.

Leave a Reply to Alejandro Cancel reply

Your email address will not be published. Required fields are marked *

Solve the maths problem shown below before posting: *