question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MSTest.TestAdapter does not get nuget-restored if the target framework is .NETStandard2.0

See original GitHub issue

Description

MSTest.TestAdapter does not get nuget-restored if the target framework is .NETStandard2.0

Steps to reproduce

  1. Install Visual Studio 15.5.0 Preview 2
  2. Create a new project using File | New Project | Visual C# | .NET Standard | Class Library (.NET Standard)
  3. Add a NuGet Reference to the project to MSTest.TestFramework (v1.2.0)
  4. Add a NuGet Reference to the project to MSTest.TestAdapter (v1.2.0)
  5. Build the project

Expected behavior

No warning. The MSTest packages should get NuGet-restored as expected.

Actual behavior

warning NU1701: Package ‘MSTest.TestAdapter 1.2.0’ was restored using ‘.NETFramework,Version=v4.6.1’ instead of the project target framework ‘.NETStandard,Version=v2.0’. This package may not be fully compatible with your project.

AB#1575875

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:32 (16 by maintainers)

github_iconTop GitHub Comments

6reactions
ionspherecommented, Mar 8, 2019

If I have a library that I want to make sure runs on any NET Standard, why shouldn’t it be possible? Isn’t the point of having a reference in VisualStudio stating “NETStandardLibrary 2.0” means all applicable references of that library set? And if so, how testing on NET Core 2.2 proves that the library can run on any NET Standard? There is quite a chance that it may end up requiring NET Framework 4.7.2 with this kind flaky testing.

4reactions
abatishchevcommented, Jun 24, 2020

Any updated on this, please? I drags on, and on, and on.

Warning NU1701: Package ‘MSTest.TestAdapter 2.1.2’ was restored using ‘.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8’ instead of the project target framework ‘.NETStandard,Version=v2.1’. This package may not be fully compatible with your project.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using MSTest Framework for testing applications targeting ...
NET Core 1.0 and referencing my system-under-test assemblies that target .NET Standard 1.6 - and it works just fine. The question is -...
Read more >
Test explorer doesn't display/run tests for multiple target ...
I have created a simple class library that targets NETSTANDARD2.0 and NET461. ... Test run for C:\Users\xxx\Documents\Visual Studio ...
Read more >
Update to MSTestV2 - Visual Studio (Windows)
Learn to create unit test projects to target specific versions of the .NET Framework. The targeted version must be 3.5 or later, and...
Read more >
Troubleshoot .NET Framework targeting errors
This article provides resolutions for MSBuild errors that might occur because of reference issues.
Read more >
MSTest.TestAdapter 3.1.1
This package includes the adapter logic to discover and run tests. For access to the testing framework, install the MSTest.TestFramework package....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found