Problem
Rider fails to load a sqlproj project on Windows with the following error message:
[MSB4278] The imported file "$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" does not exist and appears to be part of a Visual Studio component. This file may require MSBuild.exe in order to be imported successfully, and so may fail to build in the dotnet CLI.
Cause
The legacy SQL project style uses `Import` with paths pointing to Visual Studio's SSDT components, which are not available when building with the `dotnet` CLI on non-Windows systems (or even on Windows without the proper VS workloads). This leads to the [MSB4278] error.Rider requires MSBuild bundled with VS to work with sqlproj projects.
Resolution
Use either of these options:
- If there is VS installed, go to Settings → Build, Execution, Deployment → Toolset and Build → MSBuild version to MSBuild version bundled with VS, for example:
<path_to_VS>\MSBuild\Current\Bin\amd64\MSBuild.exe - Convert legacy SQL projects to SDK-style projects through modification of the project file.
Comments
0 comments
Please sign in to leave a comment.