Common Language Runtime detected an invalid program.

Common Language Runtime detected an invalid program.

Old forum URL: forums.lhotka.net/forums/t/6139.aspx


rfcdejong posted on Tuesday, January 13, 2009

What a wonderfull exception, wow..
[System.InvalidProgramException] = {"Common Language Runtime detected an invalid program."}

I guess having a relatie business object being inherited by a person business object is the problem.. while using just 1 smart-factory which knows uses typeof() the generic type.

Does anyone has an idea what i do wrong? Please reply if u have a suggestion or have an idea.. or even if u don't know either hehe. Just such a strange exception!

The MethodCaller.CallMethod dynamic method stuff just doesn't know anymore.

try
{
result = methodHandle.DynamicMethod(obj, inParams);
}
catch (Exception ex)


obj --> {U4A.Ceedrie.Data.Relatiemanagement.Factory.RelatieFactory}

inParams --> {Csla.SingleCriteria}


Persoon business object

[CslaFactory("Factory Type=U4A.Ceedrie.Data.Relatiemanagement.Factory.RelatieFactory, Data.Relatiemanagement;Item Type=U4A.Ceedrie.Business.Relatiemanagement.Persoon, Business.Relatiemanagement")]
public class Persoon : Relatie
...

Relatie business object

[CslaFactory("Factory Type=U4A.Ceedrie.Data.Relatiemanagement.Factory.RelatieFactory, Data.Relatiemanagement;Item Type=U4A.Ceedrie.Business.Relatiemanagement.Relatie, Business.Relatiemanagement")]
public class Relatie : U4ABusinessBase>
...

RelatieFactory : ObjectFactory

implimenting a method

public Business.Relatiemanagement.Relatie Fetch(SingleCriteria, int> criteria)
{
...

rfcdejong replied on Tuesday, January 13, 2009

hmmm... the generic brackets aren't visible in my post, i guess the forum sees them as specials?

rfcdejong replied on Tuesday, January 13, 2009

I managed to find that it's the signature in the ObjectFactory being the cause of this InvalidProgramException. It seems that the signature cannot contain a generic, if it does then it doesn't say "Method not found", but it just gives this InvalidProgramException. Maybe that the dynamic method implimentation isn't perfect yet? Maybe someone want to take a look at the implimentation in Methodcaller.cs? Greetings, Raymond de Jong

rfcdejong replied on Friday, January 16, 2009

rfcdejong:
I managed to find that it's the signature in the ObjectFactory being the cause of this InvalidProgramException.

It seems that the signature cannot contain a generic, if it does then it doesn't say "Method not found", but it just gives this InvalidProgramException.

Maybe that the dynamic method implimentation isn't perfect yet? Maybe someone want to take a look at the implimentation in Methodcaller.cs?

Greetings,
Raymond de Jong


Can this 'bug' or 'wish' be added into the bugtracker system?

ajj3085 replied on Friday, January 16, 2009

The exception you're getting is usually caused by a bug in the compiler.  Can you post a small complete sample that reproduces the issue?

rfcdejong replied on Friday, January 16, 2009

i'll try and create a small sample when i'm back at work

Copyright (c) Marimer LLC