Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PostSharp 2.0 BadImageFormatException

We have an application here which is using postsharp to wrap certain methods within a transaction aspect derived from MethodInterceptionAspect. We use NHibernate 2.0 as an ORM for the application. There is a failure within this block of code,

public override void OnInvoke(MethodInterceptionArgs args)
{
    using (TransactionScope transaction = CreateTransactionScope())
    {
        args.Proceed();
        transaction.Complete();
    }
}

that results in the following error: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) This only seems to happen for calls to save, and not delete or get calls.

I was wondering if anyone had encountered anything similar ever?

like image 278
intervigil Avatar asked Jan 21 '10 01:01

intervigil


1 Answers

Yes, I've encountered this. Usually its a 64/32 bit problem. Check the target in your project settings.

like image 77
John Farrell Avatar answered Nov 15 '22 04:11

John Farrell