Ranorex Studio 'Invalid StructMemberDecl' on async method

Bug reports.
krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Ranorex Studio 'Invalid StructMemberDecl' on async method

Post by krstcs » Wed Dec 10, 2014 3:59 pm

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.
Shortcuts usually aren't...

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

Re: Ranorex Studio 'Invalid StructMemberDecl' on async method

Post by Support Team » Thu Dec 11, 2014 5:39 pm

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
ToolsVersionCsProjFile.png (8.12 KiB) Viewed 1154 times
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
VisualStudioFormatVersion.png (2.54 KiB) Viewed 1154 times
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
.
Image

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Ranorex Studio 'Invalid StructMemberDecl' on async method

Post by krstcs » Thu Dec 11, 2014 7:10 pm

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.
Shortcuts usually aren't...

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

Re: Ranorex Studio 'Invalid StructMemberDecl' on async method

Post by Support Team » Fri Dec 12, 2014 12:54 pm

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
.
Image

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Ranorex Studio 'Invalid StructMemberDecl' on async method

Post by krstcs » Mon Dec 15, 2014 3:25 pm

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
Shortcuts usually aren't...

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

Re: Ranorex Studio 'Invalid StructMemberDecl' on async method

Post by Support Team » Tue Dec 16, 2014 5:09 pm

Hi Kelly,

That would be great :)! Many thanks!

Regards,
Markus
.
Image

User avatar
jasoncleo
Posts: 37
Joined: Mon Jun 08, 2015 7:37 am

Re: Ranorex Studio 'Invalid StructMemberDecl' on async method

Post by jasoncleo » Fri Dec 04, 2015 5:10 am

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
Error tab.
error.png (15.49 KiB) Viewed 877 times
Attachments
Sample.zip
Sample solution that allows easy reproduction of the issue.
(6.74 KiB) Downloaded 43 times

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

Re: Ranorex Studio 'Invalid StructMemberDecl' on async method

Post by Support Team » Mon Dec 07, 2015 2:21 pm

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
.
Image