Page 1 of 1

Ranorex Studio 'Invalid StructMemberDecl' on async method

Posted: Wed Dec 10, 2014 3:59 pm
by krstcs
Ranorex 5.2.1
Windows 7
.NET 4.5

I'm getting an "invalid StructMemberDecl" error after editing an async method in user code. I can compile just fine and it doesn't error, so it appears that the IDE is not reading the .NET 4.5 libraries correctly for real-time error checking. Note: The exact same code works just fine in VS 2013.

My guess is that this is, once again, due to Ranorex still using SharpDevelop 3.2, which is antiquated.

On top of that, I can't open the "*.sln" and "*_vs2010.sln" files in SD 3.2 because it says it "Can't read Microsoft Solution file format 11.00." This means that I can't check and verify that it is, indeed, an issue with SD 3.2 and not just Ranorex.

Re: Ranorex Studio 'Invalid StructMemberDecl' on async method

Posted: Thu Dec 11, 2014 5:39 pm
by Support Team
Hi Kelly,

Regarding the async method, please make sure you referenced the right DLL in Ranorex Studio and that you target at least .Net 4.0, furthermore please change the "ToolsVersion" to "5.0" in the csproj file of your Ranorex solution as shown below:
ToolsVersionCsProjFile.png
If this shouldn't solve the problem please send us the full error code and the used code, this will help us to reproduce the issue on our machines :).

Regarding the Visual Studio solution, you could change the "Format Version" to "10.00" to allow SD open it:
VisualStudioFormatVersion.png
Regarding SD 3.2, it is right that Ranorex Studio is currently based on that verison but we did a lot of work to make it really stable so we had to make many changes in the bases, so it is a more professional 3.2 ;).
Nevertheless, we are aware that an update would have many benefits.

Regards,
Markus

Re: Ranorex Studio 'Invalid StructMemberDecl' on async method

Posted: Thu Dec 11, 2014 7:10 pm
by krstcs
Ranorex Studio changes the ToolsVersion back to "4.0" every time I re-compile, so this does not work.


I posted the whole error message in the original post, all I'm getting is "invalid StructMemberDecl", nothing else.


As I said, I was targeting .NET 4.5 and the code compiles fine. The error does not stop compilation. But, if I make any changes to the code, even adding a comment, then Ranorex pops this error up. And since I can't change the ToolsVersion I can't check to make sure this fixes the problem.

Re: Ranorex Studio 'Invalid StructMemberDecl' on async method

Posted: Fri Dec 12, 2014 12:54 pm
by Support Team
Hi Kelly,

That's not good :/. From what I can see on the SD website, SD started supporting async methods with 4.2, it is therefore likely that it is currently not fully suppoerted.
I will try to reproduce the descriped issue on my machne, could you therefore share your code and the DLLs you use?

Thanks,
Markus

Re: Ranorex Studio 'Invalid StructMemberDecl' on async method

Posted: Mon Dec 15, 2014 3:25 pm
by krstcs
Markus,

I've got a few pressing things that I need to get working before the holidays. As soon as I get those done I'll create a sample solution that demonstrates the issue.

Thanks

Re: Ranorex Studio 'Invalid StructMemberDecl' on async method

Posted: Tue Dec 16, 2014 5:09 pm
by Support Team
Hi Kelly,

That would be great :)! Many thanks!

Regards,
Markus

Re: Ranorex Studio 'Invalid StructMemberDecl' on async method

Posted: Fri Dec 04, 2015 5:10 am
by jasoncleo
Is there any update on this at all? I'm using Ranorex 5.4.4 and the error is still present.

If it helps, I've got a super simple example here that reproduces the issue. The attached solution just has the one Test Suite project which targets .Net 4.5, and inside a simple C# class, there is a async method.

As mentioned by krstcs, you simply have to just start typing somewhere in the editor, and the error pops up in the error tab (see below)
error.png

Re: Ranorex Studio 'Invalid StructMemberDecl' on async method

Posted: Mon Dec 07, 2015 2:21 pm
by Support Team
Hello jasoncleo,

Thank you for providing the Ranorex Solution, but unfortunately I cannot reproduce the issue on my machine using even your solution.
May I ask if it is possible for you to have a short remote session in order to show me the issue?
Please send an email to [email protected] if this is possible.

Regards,
Bernhard