Search code examples
sql-servervisual-studiopublishdatabase-project

Could not find file dacpac?


When I try to publish a database project, while Creating Publish Preview..., I get this error: Could not find file 'C:...[DatabaseProjName]\sql\debug[DatabaseProjName].dacpac'. How do I get this file?


Solution

  • I was getting this error over and over and could not figure out why. I would get the latest, overwrite existing files, checked all of my publish connection info, checked the database project properties, still got the error.

    The cause, maybe due to a bug, I don't know, but neither building my solution nor publishing the database project was actually building the database project.

    The solution is simple, just right-click on the database project and Rebuild. This will create the dacpac file and allow you to publish.