Magic Merger thread not in STA mode

Bug reports.
ajdin
Posts: 10
Joined: Wed Mar 20, 2019 11:04 am

Magic Merger thread not in STA mode

Post by ajdin » Fri Sep 06, 2019 8:24 am

Hi,
the following output is shown in a git bash when cherry picking a commit, where the Magic Merger pops up for corresponding files:

Code: Select all

[Debug  ][Logger]: Console logger starting.
[Warn   ][Automation]: The apartment state of the current thread is not set to STA. Please make sure that all threads accessing Ranorex methods have their apartment state set to STA.
[Debug  ][Logger]: Console logger stopping.
The main method of Program.cs file belonging to the AUT is definitely in STA mode (double checked).
It may not be related to the Magic Merger, but the warnings only appear when the Merger is involved in a cherry-pick or rebase situation. Hence the assumption that it is indeed something with the Magic Merger code.

Thanks for any advice on this.
Regards.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11963
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Magic Merger thread not in STA mode

Post by Support Team » Mon Sep 09, 2019 9:59 pm

Hi ajdin,

I tried duplicating this but was unsuccessful. Below is the output I received when cherry-picking a commit from another branch that I knew would cause a merge conflict and would require the Magic Merger. The Magic Merger prompted me as expected and git committed the cherry-pick once it was complete.

Code: Select all

[email protected] MINGW64 ~/Documents/Ranorex/RanorexStudio Projects/!Keep/SampleSolution (master)
$ git cherry-pick eb31910
[master 517803f] force_conflict123
 Date: Mon Sep 9 16:41:16 2019 -0400
 1 file changed, 150 insertions(+), 138 deletions(-)
Furthermore, the Magic Merger does not touch program.cs files (where Main() resides and should always have [STAThread] attribute for Ranorex projects). If [STAThread] is being removed from your Ranorex project's program.cs, it is something or someone else doing so. The [STAThread] attribute should be above the Main() method in the test project's program.cs (example below).

Code: Select all

namespace SampleSolution
{
    class Program
    {
        [STAThread] 🠜🠜🠜
        public static int Main(string[] args)
        {
...
If you are able to provide a sample solution and/or a step-by-step guide on how to duplicate this issue, I will be happy to further investigate it. Fortunately, this appears to only be a warning and can be disregarded if you wish to not pursue it.

I hope this helps!

Cheers,
Ned
.
Image

ajdin
Posts: 10
Joined: Wed Mar 20, 2019 11:04 am

Re: Magic Merger thread not in STA mode

Post by ajdin » Wed Sep 11, 2019 1:47 pm

Hi,

thx for the answer so far. I will try to figure out when exactly the situation comes up and try to construct a possible sample solution. As you already noted it is "just" a warning and I won't put much effort in investigating this, as time is precious :D

Regards.