5

I recently got a brand new workstation and installed VS2019 on it. Previously, I was on VS2017 and working with db unit test project. Now when building our SQL Server database unit test project in VS2019, I got the following error:

The primary reference "Microsoft.Data.Tools.Schema.Sql.UnitTesting, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the assembly "Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which was built against the ".NETFramework,Version=v4.7.2" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.6.1".

And when I open db unit test design file, its showing black screen instead of the scripts window.

So do I need to downgrade the version of MSBuild or any other options to resolve this?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Magendran V
  • 1,411
  • 3
  • 19
  • 33
  • The error message says : The Test Project version of Net v4.7.2 is new than the project v4.6.1. You just need to change the Target version in the project properties. – jdweng Apr 22 '19 at 13:55
  • @jdweng Yes the db unit test project is created with target framework 4.6.1. I don't want to upgrade to 4.7.2. OR even I do upgrade the unit test design file was displayed as black screen. – Magendran V Apr 22 '19 at 13:57
  • The test case looks like it defaulted to new version of Net. I would open the .proj file with notepad and see what versions are selected. It is easier to look at the proj file than to go through all the properties menus inside Visual Studio. – jdweng Apr 22 '19 at 14:04
  • @MagendranV were you able to find a solution to your issue? Having the same issue... Thanks in advance. – ardila May 14 '21 at 07:12

0 Answers0