The bug is very old but MS didn't fix it so far.
I had a VS2015 solution (many projects, with main ASP.NET one) and I opened it in VS 2017.
Here is what I saw when I tried to build it:
So, I figured, okay, some referenced broke, I went into Project References, removed those two (...Sql.UnitTesting and ...Tools.Components), and tried to add them back. What did I saw? Of course, this:
The version is wrong, its 15.1.0.0 instead of previous 15.0.0.0 (for both DLLs). Big deal, you say, but it still doesn't compile:
It tells me that the versions are mismatched and I have to create some assembly-bindings in the web.config file. Which I did, first manually, then via the double-click on the warning, as it suggested. Nothing changed. I still can't get my project build.
Previous SO questions (Automatic reference to Microsoft.Data.Tools.Schema.Sql.UnitTesting, Where is the Microsoft.VisualStudio.TestTools.UnitTesting namespace on VS2010?) don't help much, I cannot remove SSDT component, as it breaks the loading of the web-project completely. And my project isn't any sort of SQL Testing project. It is just a regular ASP.NET 4 web app.
What can I do to fix this?
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.
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.
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.