Missing Microsoft.Data.Tools.Schema.Sql.UnitTesting. Again

In your test project file, remove this code:

<Import Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.Sql.UnitTesting.targets" Condition="'$(SQLDBExtensionsRefPath)' != ''" />
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.Sql.UnitTesting.targets" Condition="'$(SQLDBExtensionsRefPath)' == ''" />
<PropertyGroup>
    <SsdtUnitTestVersion>2.0</SsdtUnitTestVersion>
</PropertyGroup>

And replace it with this:

<ItemGroup Condition="$(VisualStudioVersion) == '15.0'">
    <Reference Include="Microsoft.Data.Tools.Schema.Sql, Version=13.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
      <HintPath>$(SSDTPath)\Microsoft.Data.Tools.Schema.Sql.dll</HintPath>
      <Private>True</Private>
    </Reference>
    <Reference Include="Microsoft.Data.Tools.Schema.Sql.UnitTesting, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
      <HintPath>$(SSDTUnitTestPath)\Microsoft.Data.Tools.Schema.Sql.UnitTesting.dll</HintPath>
      <Private>True</Private>
    </Reference>
    <Reference Include="Microsoft.Data.Tools.Schema.Sql.UnitTestingAdapter, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
      <HintPath>$(SSDTUnitTestPath)\Microsoft.Data.Tools.Schema.Sql.UnitTestingAdapter.dll</HintPath>
      <Private>True</Private>
    </Reference>
  </ItemGroup>
<PropertyGroup>
    <SsdtUnitTestVersion>3.1</SsdtUnitTestVersion>
  </PropertyGroup>
 <Import Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.Sql.UnitTesting.targets" Condition="$(VisualStudioVersion) != '15.0' And '$(SQLDBExtensionsRefPath)' != ''" />
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.Sql.UnitTesting.targets" Condition="$(VisualStudioVersion) != '15.0' And '$(SQLDBExtensionsRefPath)' == ''" />

This is as per the official microsoft dev community help thread here.

Although for me it didn't work. Had to add propertygroup tags around ssdt version. You might want to keep it or remove it as per your project configurations.


I have searched the project's file and found this:

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

Then I searched the PC for Microsoft.Data.Tools.Schema.Sql.UnitTesting.targets and I found some interesting results (clickable):

So, my previous studio, VS2015, had the v14 version of the file and the referenced were of 14 version as well, which is fine.

But the new VS2017's had references to the 15.0.0.0, according to the file contents:

But the actual folder, which should contain these files has 15.1.0.0 version! And the binding redirects in my web.config file just doesn't work for some reason.

I see two solutions from here, change the Microsoft.Data.Tools.Schema.Sql.UnitTesting.targets file so that it would contain 15.1.0.0 version, or replace 15.1.0.0 with 15.0.0.0 ones. I'll go with former now. Update soon.

Update

It still didn't help. No there are no build errors but the project build failed.

I also tried to remove those two XML lines from project's file and it kinda worked. Not so sure, because it now behaves even more weird.

It gave me a strange "missing ','" error on a line with somemethod(out Ticket ticket); (new C#7 feature), which is fine and doesn't have any errors, the error itself disappeared after 1 seconds after I saw it, but when I switched it back to C#6 way, it all finally built without problems. I'll try to run the project now.

Update

Yeah, just as I thought, dear Microsoft. Now it gives me this:

So, there are some changes are yet to be made for me to finish my manual upgrade a simple webapp from vs2015 to vs2017.


enter image description here

Select NO and the Identity and Path should automatically resolve.

enter image description here