Red Gate forums :: View topic - Array size control parameter type not supported error
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 6
SmartAssembly 6 forum

Array size control parameter type not supported error

Search in SmartAssembly 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
Bodwad



Joined: 08 Jan 2013
Posts: 2

PostPosted: Tue Jan 08, 2013 12:58 pm    Post subject: Array size control parameter type not supported error Reply with quote

Hello, I am getting a strange error on one of my DLL's being run through SmartAssembly 6.7 and I cant find any mention anywhere else on this forum so I was wondering if anyone had come accross this problem before.

When I run my DLL through Smart Assembly with all features switched off(for testing purposes) I get the following error

System.Runtime.InteropServices.MarshalDirectiveException: Array size control parameter type not supported.
----------------------------------------------------------------------
at System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegateInternal(Delegate d):

The dll works fine if I dont run it through Smart Assembly and all my other dll's and exe's work just fine. I was wondering what smart assembly does to the dll even when all settings are disabled?

Thanks for any help you can offer Smile

Paul
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 585

PostPosted: Thu Jan 17, 2013 12:20 am    Post subject: Reply with quote

I noticed that the following discussion was initiated by a *similar* error to yours:

http://www.developmentnow.com/g/21_2003_9_0_0_103952/MarshalDirectiveException--Array-size-control-parameter-must-be-an-integral-type.htm



The solution was a little bit of refactoring to make the size of the array passed explicit, I think.

Maybe it helps as a workaround.

I'll continue to research this as it is rather interesting! Smile
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 585

PostPosted: Thu Jan 17, 2013 12:23 am    Post subject: Reply with quote

The IL that smartassembly produces will differ slightly from the original (even with no features on(!)). It will use the long form of instructions whereas yours will use the short form (e.g. brtrue not brtrue.s).

http://en.wikipedia.org/wiki/List_of_CIL_instructions

I've a feeling this is *too* interesting lolz
Back to top
View user's profile Send private message
Chris.Allen



Joined: 12 Mar 2009
Posts: 585

PostPosted: Thu Jan 17, 2013 12:41 am    Post subject: Reply with quote

Also, what calling convention are using using? Smartassembly will use Standard I believe.
Back to top
View user's profile Send private message
Bodwad



Joined: 08 Jan 2013
Posts: 2

PostPosted: Thu Jan 17, 2013 9:44 am    Post subject: Reply with quote

Hello thanks for all the info Very Happy

The problem has been submitted to Redgate support at the moment and they are looking into the issue as they have a demo to work with. I will let you know what happens Cool

Paul
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group