.net 3.5 unit tests no longer work
See original GitHub issueSteps 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:
- Created 5 years ago
- Comments:13 (6 by maintainers)
Agree with @jbrown16 . It was working fine in an earlier v15.9.x release…
@jbrown16 I am trying to push it for 15.9.9, will update once it is in. Thanks for your patience.