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.

.net 3.5 unit tests no longer work

See original GitHub issue

Steps to reproduce

Create a project targeting .net 3.5 in the latest version of visual studio (15.9.5) Create a unit test Run the unit test

Expected behavior

Tests will run successfully

Actual behavior

Tests fail with the following message: Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: Framework35 is not supported. For projects targeting .Net Framework 3.5, please use Framework40 to run tests in CLR 4.0 "compatibility mode".

Environment

Windows 10 x64 Visual Studio 15.9.5

From investigating both the cause and what the error message was indicating for me to do I found this. Suggesting that the change may have been intentional, however the suggested solution of changing the targeted .net framework to 4.0 is completely unacceptable.

There are so many projects dependent on targeting .net 3.5 due to legacies that they deal with. In my case Unity3d is the main restriction upon this project and whilst unity3d has upgraded to 4.6.1 recently, there are still numerous bugs in the mono environment on mac/ios and we can’t just switch to it. Just telling developers to change the targeted platform is both ignorant of legacy systems and extremely arrogant.

Further complicating the issue is nuget, it will pull and update projects based upon your targeted framework, so if you change the targeted framework you won’t get the same nuget package. If i split a project up into a 3.5 source project and 4.0 unit test project, how can I be sure I’ll have the same packages and that running under 4.0 the behavior will be the same as a live environment.

Any other suggestions that don’t involve me targeting 4.0?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
jhedlundcommented, Feb 19, 2019

Agree with @jbrown16 . It was working fine in an earlier v15.9.x release…

1reaction
singhsarabcommented, Mar 7, 2019

@jbrown16 I am trying to push it for 15.9.9, will update once it is in. Thanks for your patience.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tests not running in Test Explorer - visual studio
I am currently working on a solution that has currently 32 Unittests. I have been working with the resharper test runner - which...
Read more >
Unit Tests Target Earlier Version of .NET Framework
When you create a test project in Microsoft Visual Studio, the most recent version of the .NET Framework is set as the target,...
Read more >
SharePoint and Unit Testing - problem deploying dll to be ...
Anyone know why targeting the test project to .NET 3.5 breaks VS's ability to locate the .dll? Or is preventing me from debugging?...
Read more >
unittest — Unit testing framework
Such a working environment for the testing code is called a test fixture. A new TestCase instance is created as a unique test...
Read more >
How To Resolve Issue Of Test Project Not Running The ...
This article describes the scenario of unit test project not running the test cases in .NET project and the solution to this issue...
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