Search code examples
visual-studioredgatesqlproj

VS2017 can not load sqlproj after IDE update wrong $(MSBuildExtensionsPath) value


I just update my visual studio and I am not able to open my sqlproj included into my sln.

The issue is the following one :

error : The imported project "C:\agent\Microsoft.Data.Tools.Msbuild\lib\net40\Microsoft.Data.Tools.Schema.SqlTasks.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

I do not have the C:\agent folder present in my HD.

I think something changed my variables used by the sqlproj file.

<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />

How can I reset thoses variables : $(MSBuildExtensionsPath), $(MSBuildToolsVersion)

I strongly think this is related to my MSBuildToolsVersion variable.

I tried to repaire my vs2017 community installation. Still not working :/

Any idea?


Solution

  • Nothing related to those variable.

    I was at the wrong place in the sqlproj file.

    I should look into this:

      <Import Condition="'$(SQLDBExtensionsRefPath)' != ''" Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
      <Import Condition="'$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
    

    I just unset this variable SQLDBExtensionsRefPath from my windows environement. Because it was set, it will take the first parth instead of the one related to my Visual studio.