Search Issue Tracker
Won't Fix
Votes
0
Found in
2017.1.0f3
Issue ID
932017
Regression
No
TargetInvocationException when running NUnit tests in Visual Studio
Steps to reproduce:
1. Make sure you have ReShaper installed(for easiest reproduction)
2. Download and open the attached project
3. Open the NewBehaviourScript script in Visual Studio
4. Run the test with CTRL+R+U
Expected result: test runs fine
Actual result: test fails with a TargetInvocationException
Reproduced on 5.6.2p4, 2017.1.0f3, 2017.2.0b3
5.5.4f1 does not appear to have the NUnit framework
Won't fix because:
You can not run tests in VS+ReShaper and get the same execution as you would when executing tests in Unity test runner.
The reason is that ReShaper basically starts its own runner, and by that, all the thread handling and etc we do so that nunit works with Unity is not done.
Maybe the reason it worked before, was that we were using an older nunit version. Nunit changed a lot from v2 to v3 and how the execution of tests are done.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
FlorentFal
Dec 07, 2017 19:21
Here's is the workaround:
https://assetstore.unity.com/packages/tools/utilities/ncrunch-adapter-for-unity-101906 by @networm
FlorentFal
Nov 11, 2017 14:56
Bruno85, maybe that if we configure VS to use another version of nunit (not the one provide with Unity) it could work !!? But I'm bit septic about our capacity to change VS project without break internal Unity build process....
If you got any workaround, please share it in a comment !
bye
Bruno85
Nov 03, 2017 02:15
Is there a workaround for this issue?
FlorentFal
Nov 02, 2017 12:38
Please, could you explain why this issue will not be fixed !?
Thanks