title: Schema compare - Unexpected exception caught during population of source model: Object reference not set to instance object
body: <p>I've been running a schema compare in a database project in Visual Studio 2017, when I do this I get the following message in the Error List tab:</p>
  
  <blockquote>
    <p>Unexpected exception caught during population of source model: Object
    reference not set to instance object.</p>
  </blockquote>
  
  <p>I found <a href="https://hendrikbulens.com/2018/10/03/how-to-fix-sql-server-data-tools-error-unexpected-exception-caught-during-population-of-source-model-in-visual-studio-2017/" rel="noreferrer">this blog</a>, which appears to be the same issue, but the suggested solution (of removing the entry using the Select Target Schema window) has not worked despite trying it a few times.</p>
  
  <p>The compare has (and does) work fine with the same project and database in Visual Studio 2013, so I have a work around, but it would be nice to know what is causing the problem (and leave VS2013 behind!)</p>