I created a scripting engine that accepts source code, source language,
and various other properties that specify imports, references, and
such. Then, I created a ScriptPanel that allows editing of all this
data, with a drop down for the language, list boxes for the imports and
references, and a highlighting textbox for the script itself.

Next, I inherit from the scripting engine to create custom scripts.
These custom scripts contain properties such as RequiredMethodName,
RequiredMethodParameters, and RequiredMethodReturnValue to clarify how
they should be written, so that consumers of the custom script know
what and how to call into the script. Likewise, the ScriptPanel
contains these same properties such that the panel can be assigned the
values from the custom scripts. In this way, the panel can test whether
the requirements are met in the edited script.

Seems logical, right?

Well, the properties on the custom scripts and on the ScriptPanel are
like so:

Public Property RequiredMethodName() As String
Public Property RequiredMethodParameters() As System.Type()
Public Property RequiredMethodReturnValue() As System.Type

Notice that the types of these properties are "System.Type" and an
array of "System.Type". However, this is apparently not allowed, though
I can find no documentation that says so. Whenever I compile, I get no
errors. Even the background compiler does not give me any squigglies,
and IntelliSense shows the correct property signatures.

However, whenever I actually run the application, whether in debug mode
or by launching the compiled EXE, I get the following error:

System.MissingMethodException: Method not found: Void
ScriptPanel.set_RequiredMethodParameters(System.Type[])

Well, that doesn't make any sense! The property is right there. How can
it not be found? In the code editor, even when I right-click and select
Goto Definition while on that property, it takes me right there to the
code or to the Object Browser, depending on how I reference the project
containing the ScriptPanel (I've tried it both ways).

So, I thought, maybe it doesn't like properties of type System.Type or
arrays of System.Type. (I also tried just with the single System.Type,
commenting out the array, and I get the same error, albeit with a
different method name.) So, I changed the properties to pairs of
Set/Get functions like so:

Public Function GetRequiredMethodParameters() As System.Type()
Public Sub SetRequiredMethodParameters(ByVal parameters As
System.Type())

Again, I get the following error:

System.MissingMethodException: Method not found: Void
ScriptPanel.SetRequiredMethodParameters(System.Type[])

WHAT??!! I just created that function. There it is right there! What
gives? Can you just not pass System.Types around? That would be very
strange if so, and no where can I find that this practice is not
allowed. And if it is not allowed, I am totally screwed because I need
to pass types around. Passing strings around might work, but then
developers and script writers are going to have to fully qualify
everything all the time. Not gonna happen. :)

I have changed properties to functions, the names of the functions,
putting the ScriptPanel in another namespace, the names of parameters,
everything. The only thing that fixes this issue is removing
System.Type and arrays of System.Type. Even when I look at the DLL with
ILDASM, it shows the properties or functions as being there. Yet, at
runtime, it cannot find them.

Can someone please explain this to me? There seems to be something
really wrong here and it is driving me bonkers.

RE: Missing Method Exception (REALLY Weird!!!) PLEASE HELP by Gloria

Gloria
Tue May 17 05:25:33 CDT 2005

Hello Matthew,

We are experiencing the same issue in our application. Where you able to
solve it?

Thanks,
Gloria

"MatthewRoberts" wrote:

> I created a scripting engine that accepts source code, source language,
> and various other properties that specify imports, references, and
> such. Then, I created a ScriptPanel that allows editing of all this
> data, with a drop down for the language, list boxes for the imports and
> references, and a highlighting textbox for the script itself.
>
> Next, I inherit from the scripting engine to create custom scripts.
> These custom scripts contain properties such as RequiredMethodName,
> RequiredMethodParameters, and RequiredMethodReturnValue to clarify how
> they should be written, so that consumers of the custom script know
> what and how to call into the script. Likewise, the ScriptPanel
> contains these same properties such that the panel can be assigned the
> values from the custom scripts. In this way, the panel can test whether
> the requirements are met in the edited script.
>
> Seems logical, right?
>
> Well, the properties on the custom scripts and on the ScriptPanel are
> like so:
>
> Public Property RequiredMethodName() As String
> Public Property RequiredMethodParameters() As System.Type()
> Public Property RequiredMethodReturnValue() As System.Type
>
> Notice that the types of these properties are "System.Type" and an
> array of "System.Type". However, this is apparently not allowed, though
> I can find no documentation that says so. Whenever I compile, I get no
> errors. Even the background compiler does not give me any squigglies,
> and IntelliSense shows the correct property signatures.
>
> However, whenever I actually run the application, whether in debug mode
> or by launching the compiled EXE, I get the following error:
>
> System.MissingMethodException: Method not found: Void
> ScriptPanel.set_RequiredMethodParameters(System.Type[])
>
> Well, that doesn't make any sense! The property is right there. How can
> it not be found? In the code editor, even when I right-click and select
> Goto Definition while on that property, it takes me right there to the
> code or to the Object Browser, depending on how I reference the project
> containing the ScriptPanel (I've tried it both ways).
>
> So, I thought, maybe it doesn't like properties of type System.Type or
> arrays of System.Type. (I also tried just with the single System.Type,
> commenting out the array, and I get the same error, albeit with a
> different method name.) So, I changed the properties to pairs of
> Set/Get functions like so:
>
> Public Function GetRequiredMethodParameters() As System.Type()
> Public Sub SetRequiredMethodParameters(ByVal parameters As
> System.Type())
>
> Again, I get the following error:
>
> System.MissingMethodException: Method not found: Void
> ScriptPanel.SetRequiredMethodParameters(System.Type[])
>
> WHAT??!! I just created that function. There it is right there! What
> gives? Can you just not pass System.Types around? That would be very
> strange if so, and no where can I find that this practice is not
> allowed. And if it is not allowed, I am totally screwed because I need
> to pass types around. Passing strings around might work, but then
> developers and script writers are going to have to fully qualify
> everything all the time. Not gonna happen. :)
>
> I have changed properties to functions, the names of the functions,
> putting the ScriptPanel in another namespace, the names of parameters,
> everything. The only thing that fixes this issue is removing
> System.Type and arrays of System.Type. Even when I look at the DLL with
> ILDASM, it shows the properties or functions as being there. Yet, at
> runtime, it cannot find them.
>
> Can someone please explain this to me? There seems to be something
> really wrong here and it is driving me bonkers.
>
>