Running UI Related Tests with R#2016.1 SDK

29 views
Skip to first unread message

Sebastian P.

unread,
Apr 21, 2016, 12:09:02 PM4/21/16
to resharper-plugins
Hey guys,

I cannot run my test suite anymore after upgrading the dependency to the ReSharper SDK to version 2016.1 (for the record, it was still working in one of the EAP versions).

The error message is quite explicit about the cause (the full log is included in [1]):

SetUp : JetBrains.TestFramework.Utils.TestLoggerListener+TestWrapperException : 3 exceptions were thrown.
#1: Cannot create a Dispatcher on thread “Runner thread”:5 because the Dispatcher implements the Single-Threaded Apartment pattern, and this thread is MTA rather than STA.

So it seems to be that the way to initialize the TestEnvironmentAssembly has changed. You will find my current version in [2], any pointers on how to fix it are appreciated. Thanks!

best
Sebastian

Matt Ellis

unread,
Apr 22, 2016, 10:23:19 AM4/22/16
to resharper-plugins
Hi Sebastian. You need to add:

[assembly: RequiresSTA]

to one of your files, e.g. AssemblyInfo.cs. See the nunit docs for more details.

Regards
Matt

Sebastian P.

unread,
May 9, 2016, 5:13:38 AM5/9/16
to resharper-plugins
I tried adding the [RequiresSTA] attribute to your TestEnvironmentAssembly before, but that did not change anything. Adding it to the assembly did the trick. Thanks for the hint!

best
Sebastian
Reply all
Reply to author
Forward
0 new messages