This project is read-only.

NModel Stops working after changing method signature?

Nov 15, 2008 at 5:55 PM

Hi, I needed to make a change in my model, and NModel stopped working after I made a change in a method signature.  The error I'm getting is:

Invocation of 'HW5Model.Factory.CreateElevatorUI' failed: System.Reflection.Targ
etInvocationException: Exception has been thrown by the target of an invocation.
---> NModel.Execution.ModelProgramUserException: In class ElevatorUI, method Up
, Enabling condition UpEnabled does not match the input parameter types of Up
at NModel.Execution.LibraryModelProgram..ctor(Assembly modAssembly, String mo
delName, Set`1 featureNames) in c:\codeplex\NModel\src\NModel\Execution\ModelPro
gramProvider\LibraryModelProgram.cs:line 344
at NModel.Execution.LibraryModelProgram..ctor(Assembly modAssembly, String mo
delName) in c:\codeplex\NModel\src\NModel\Execution\ModelProgramProvider\Library
ModelProgram.cs:line 192
at HW5Model.Factory.CreateElevatorUI() in C:\Documents and Settings\Jeremy Ma
xwell\My Documents\Visual Studio 2008\Projects\MathNet.Iridium-2008.8.16.470\Iri
dium.PUT\HW5\HW5Model\ElevatorUI.cs:line 139
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] argum
ents, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle
typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] argume
nts, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwn
er)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke
Attr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisib
ilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke
Attr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at NModel.Algorithms.OfflineTestGenerator.RunWithCommandLineArguments(String[
] args) in c:\codeplex\NModel\src\NModel\Algorithms\OfflineTestGenerator.cs:line
198




I don't understand the error, because it references files in the C:\codeplex directory, which does not even exist!  I tried a clean rebuild of my project, but it didn't work.  Any help would be appreciated.




Nov 15, 2008 at 7:54 PM
Hi!

The key to this problem is here:

---> NModel.Execution.ModelProgramUserException: In class ElevatorUI, method Up
, Enabling condition UpEnabled does not match the input parameter types of Up

You have a class ElevatorUI where you have an action Up. Action Up has different parameter types than the guard condition function UpEnabled.
If this does not solve your problem, please post the code of ElevatorUI for reference.

The codeplex directory refers to where NModel was built when building the release. The key to reading the error messages currently is to locate lines concerning  files from your model and see what the error messages are.

Hope this helps.
Nov 15, 2008 at 8:34 PM

That was it, thank you very much!