57

I created a new SQL Server Database Project in VS2013 (Update 3) and attempted to build but it fails. The only build output I receive follows:

------ Build started: Project: Database1, Configuration: Debug Any CPU ------
    Creating a model to represent the project...
Done building project "Database1.sqlproj" -- FAILED.

Build FAILED.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

If I build the project via MSBuild.exe with detail verbosity I see the following inner failure:

Task "SqlBuildTask"
  Creating a model to represent the project...
Done executing task "SqlBuildTask" -- FAILED.

After searching the web I have tried the following to resolve this to no avail:

-Restart VS

-Restart machine

-Repair VS Update 3 and reboot

-Repair VS2013 and reboot

What am I missing?

chief7
  • 14,263
  • 14
  • 47
  • 80
  • Out of curiosity, if you install the stand-alone SSDT for 2012, can you get a successful build doing the same things you did here? Did you import an existing database? Do you have any errors/warnings in your project? – Peter Schott Sep 11 '14 at 17:31
  • I don't have 2012. A migrated database project (2010 to 2012) in another solution does build successfully in 2013. No errors or warnings. I'm using VS2013 U3 Ultimate. – chief7 Sep 11 '14 at 20:53
  • What happens if you re-create this DB in a new project? How did you start this project? Import of existing DB or from scratch? (And I realize you don't have 2012, but if you download the bits for SSDT from the site it would install the basic IDE for you to use w/ SSDT. Probably not necessary if other projects work in 2013.) – Peter Schott Sep 12 '14 at 03:12
  • Same issue with a new project. Started with File|New|Project, no imports. – chief7 Sep 12 '14 at 12:49
  • Is this with no objects or after you've created them? Can you import objects into the project to see if it builds then? I still think it might be worth installing the 2012 SSDT bits side by side to see how that works or if it behaves differently. – Peter Schott Sep 12 '14 at 14:15
  • I've tried with and without objects, both custom created and imported. No change. I did install SSDT for VS12 and it works fine but VS2013 is still broken. – chief7 Sep 12 '14 at 17:26
  • What happens if you pull that working project from 2012 into 2013? Still broken? – Peter Schott Sep 12 '14 at 20:00
  • What version of SSDT do you show in your tools? I have 12.0.40403.0. You can usually find details about the current SSDT bits here: http://blogs.msdn.com/b/ssdt/ – Peter Schott Sep 12 '14 at 23:35
  • I show SSDT version 12.0.40706.0 in VS2013. – chief7 Sep 15 '14 at 13:11
  • Just upgraded to that myself, but have no issues building an existing project for 2013. Admittedly, I was opening a project created in SSDT 2012, but didn't have any issues doing so. – Peter Schott Sep 15 '14 at 15:18

4 Answers4

102

After contacting a friend at Microsoft, he suggested repairing the Data Tools install at

https://learn.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt

And that resolved it.

Thanks Chuck!

Jérôme MEVEL
  • 7,031
  • 6
  • 46
  • 78
chief7
  • 14,263
  • 14
  • 47
  • 80
  • Worked for me too! as an FYI I got the error with a DB project that I set to SQl Server 2012 not the default 2014 – EGP Mar 27 '15 at 21:20
  • Worked for me, first time using the data tools and needed a repair. – ConstantineK Apr 07 '15 at 17:36
  • This could have taken hours to figure out. Thanks for this it worked for me too – Jobbo Jun 19 '15 at 15:37
  • Thanks for the tip. Unfortunately, we are using Visual Studio Online to build and getting this error. We may have to repair the data tools on all of the build agents, which I'm not looking forward to. – Dan Csharpster Jun 16 '16 at 18:19
  • 2
    @DanCsharpster FYI: You can run SSTDSetup from the command line, so can automate repair and (in this case) force reboot of all agents by having them run this: `\\myserver\share\SSDTSetup.exe /repair /silent /forcerestart`. You can use PowerShell's `Invoke-Command` (or your tool of preference) for this. e.g. http://stackoverflow.com/questions/9535515/powershell-execute-remote-exe-with-command-line-arguments-on-remote-computer. NB: run `SSDTSetup.exe /?` for a complete list of command line options. – JohnLBevan Dec 09 '16 at 15:11
  • 1
    For those of you who are nervous about randomly downloading the .exe file directly from the provided link, you can find the download on the Microsoft site here: https://learn.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt – Tyler Nielsen Aug 17 '17 at 18:59
11

I had a similar issue and as mentioned in the accepted answer repairing is the solution. But unfortunately the link did not gave me an exe that says repair/UnInstall. I went ahead and run exe still issue persists.

I resolved it by updating the sql data tools using Extensions and Updates. Following are the steps.

  1. Open visual studio.
  2. Go to tools menu and click on Extensions and Updates.
  3. Under the updates you will find an update for database proj.
  4. By clicking it, it will download an exe.
  5. When you run the exe it will ask for Repair/UnInstall.
  6. Click repair and proceed.
Mady
  • 459
  • 1
  • 11
  • 26
0

Also check that you are using the correct version of MSBuild. There are usually multiple MSbuild exe's on your machine. The 14.0 version should be working with the Visual Studio 2015.

thelem
  • 2,642
  • 1
  • 24
  • 34
Tyler
  • 25
  • 9
0

I had this issue as well, but the problem was with the value in the project property "DSP". I had edited the proj file to build a dacpac for SQL 2012 and then edited it again for SQL 2014, and was getting this error for both.

The original project that was targeting SQL 2008 worked fine still, so it wasnt an installation issue.

In my editing had misspelled the values for the DSP element.

  <DSP>Microsoft.Data.Tools.Schema.Sql.Sq110DatabaseSchemaProvider</DSP>

And it should have been (where sql is spelled with the L)

  <DSP>Microsoft.Data.Tools.Schema.Sql.Sql110DatabaseSchemaProvider</DSP>

Fixing that spelling resolved the error.

StingyJack
  • 19,041
  • 10
  • 63
  • 122