4
votes

I have just upgraded Visual Studio from 2017 to 2017.3. Now when I try to build I get this error on my database project:

Error: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.3\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" was not found. Also, tried to find "Microsoft\VisualStudio\v15.3\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" in the fallback search path(s) for $(MSBuildExtensionsPath) - "C:\Program Files (x86)\MSBuild" . These search paths are defined in "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe.Config". Confirm that the path in the declaration is correct, and that the file exists on disk in one of the search paths. C:\Users\Ian\Documents\Maslow\Maslow\Database\Database.sqlproj

Note that this path includes v15.3. The files are available, but the folder is called v15.0.

If I edit my Database.sqlproj it contains the line:

<SSDTExists Condition="Exists('$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets')">True</SSDTExists>

Note the user of the $(VisualStudioVersion) variable.

I could hard code that to 15.0, but then it will break for anyone using a different version of Visual Studio. How can I resolve this problem in a way that won't create new problems for other users?

2

2 Answers

3
votes

I had the same issues with except with v15.4. Hardcoding $(VisualStudioVersion) to match my folder (15.0) resolved the error, but exposed a slew of other errors even more esoteric and I was still not able to build.

In my case I happened to also be running the ReSharper Build engine instead of the Visual Studio build engine. Once I disabled the ReSharper Build engine I was able to get a clean build. (Menu->ReSharper->Options - Tools category, Build - General.) I'm running ReSharper version 2017.1

EDIT: Just found this post on the ReSharper forum: https://resharper-support.jetbrains.com/hc/en-us/community/posts/115000610044-Build-fails-but-only-under-Resharper-Build

One user's solution there was to re-install VisualStudio which corrected the path that the ReSharper Build engine was using. (apparently it gets out of whack when VS is upgraded.)

0
votes

I wasn't able to get this to work at all in Visual Studio 2017.3 and wasn't able to find an installer for Visual Studio 2017.2 or earlier.

I am therefore currently using Visual Studio 2015.

Possibly related bug report: https://github.com/Microsoft/msbuild/issues/2369