title: Register Data-Tier Application - "Database source is not a supported version of SQL Server" error
body: <p>I have a SQL Server Express 2014 database.  In SSMS, whenever I attempt to register the database as a data-tier application, I receive the error "Database source is not a supported version of SQL Server (localdb)\ProjectsV12 (Microsoft.SqlServer.Dac)".  How do I resolve?</p>
  
  <p><strong>TMI:</strong></p>
  
  <p>I have a SSDT project where I am attempting to write conditional scripts based on database version.  So for instance, a lookup script might look like:</p>
  
  <pre><code>DECLARE @version_source AS VARCHAR(100) = (SELECT type_version FROM msdb.dbo.sysdac_instances WHERE database_name = DB_NAME());
  
  IF @version_source IS NULL
  BEGIN
      SET IDENTITY_INSERT instructor_title ON;
  
      INSERT INTO instructor_title (id, name, description) VALUES
          (1, 'Instructor', NULL),
          (2, 'Assistant Professor', NULL),
          (3, 'Associate Professor', NULL),
          (4, 'Professor', NULL)
      ;
  
      SET IDENTITY_INSERT instructor_title OFF;
  END
  </code></pre>
  
  <p>When I publish, I check "Register as a Data-tier Application" and everything works fine.  When I start debugging (which deploys to (localdb)\ProjectsV12), my logic fails.  The SQL Server express database won't register as a data-tier application.  This results in the variable @version_source always returning NULL, so my script condition always is true.  I realize I could write an idempotent or database state conditional script instead, but feel strongly a database version conditional script is the best architecture decision.</p>