LorneCash
LorneCash

Reputation: 1614

Visual Studio LightSwitch will not Build

I'm working with an old C# LightSwitch HTML project that connects to SharePoint and I need to make a few changes. Unfortunately not enough to justify migrating to another technology/platform, but anyways...

I fire up my Visual Studio 2015 and the project won't build. I've of course googled for and tried everything I can think of and long story short even if I create a new C# LightSwitch HTML project and try to build it, it fails. Here's the error I get:

An exception occurred when building the database for the application. An error occurred during deployment plan generation. Deployment cannot continue. Error SQL0: Required contributor with id 'Microsoft.LightSwitch.DataRetentionDeploymentPlanModifier.v5.0' could not be loaded. Error SQL0: Required contributor with id 'Microsoft.LightSwitch.LocalDbLocationModifier.v5.0' could not be loaded. GraphicsApp C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\LightSwitch\v5.0\Microsoft.LightSwitch.targets 160

If I go to line 160 (double-clicking on the error) I see this (Starting at line 160):

<BuildSchema Inputs="@(ServerMetadataFiles)"
             ServerGeneratedMetadataFiles="@(ServerGeneratedMetadataFiles)"
             Collation="$(DatabaseCollation)"
             DatabaseProject="@(_DatabaseProject)"
             ProjectPath="$(MSBuildProjectFullPath)"
             OutputDirectory="Bin\Data"
             SqlExpressInstanceName="$(SqlExpressInstanceName)"
             ExternalDataSources="@(ServerExternalDataSources)"
             Condition="'$(SkipBuildSchema)' == ''"/>

I've tried searching everything I can think of but I'm not finding anything that even sounds remotely the same except this link. But it's talking about V4 and only says that the solution was to:

"right clicking on the project in solution explorer... [and] upgrade the project"

But that doesn't help me at all because I don't see any option to upgrade anything and again I have the same exact problem on the brand new project I create.

Upvotes: 5

Views: 1892

Answers (5)

kiran..
kiran..

Reputation: 19

Try by installing microsoft office developer tools for visual studio 2015

https://www.microsoft.com/en-us/download/details.aspx?id=51683

Upvotes: 0

Michael Squelch
Michael Squelch

Reputation: 56

Do you know what version of SQL Server Data Tools (SSDT) you have installed?

The latest update 14.0.61707.300 breaks LightSwitch with that error.

You could try uninstalling SSDT and installing the previous version.

Upvotes: 4

spikey
spikey

Reputation: 444

For a Windows 10 machine, with previously installed Visual Studio 2017, the installation of Visual Studio 2015 and running the Lightswitch project, nothing worked, but this:

copy all the content from this location "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\130\Extensions" to "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\140\Extensions"

Found that solution on MSDN.

Upvotes: 1

TripleDDD
TripleDDD

Reputation: 11

Had same issue...
SQL Server Data Tools for Visual Studio 2015 (SSDT)
SSDT version 17.4 (14.0.61712.050) https://go.microsoft.com/fwlink/?linkid=863440
breaks our SSRS,
as does SSDT version 17.3 (14.0.61709.290) https://go.microsoft.com/fwlink/?linkid=858660
Breaks our LightSwich.
https://learn.microsoft.com/en-us/sql/ssdt/previous-releases-of-sql-server-data-tools-ssdt-and-ssdt-bi?view=sql-server-2017
By Trail and Error, found SSDT for VS2015 17.2 Works For both LightSwitch and SSRS
https://go.microsoft.com/fwlink/?linkid=852922

Upvotes: 1

Bruno Medeiros
Bruno Medeiros

Reputation: 2399

I just faced a similar situation here, but I could not find a version 13.x of SSDT and upgrading to the oldest version available in the Microsoft website didn't help.

The error was fixed when I decided to do some VS pending updates, on of them being the Office Developer Tools for VS, which was updated to

Upvotes: 0

Related Questions