PostSharp 2.0 BadImageFormatException

int*_*gil 6 asp.net-mvc postsharp

我们在这里有一个应用程序,它使用postsharp来包装从MethodInterceptionAspect派生的事务方面中的某些方法.我们使用NHibernate 2.0作为应用程序的ORM.这段代码中有一个失败,

public override void OnInvoke(MethodInterceptionArgs args)
{
    using (TransactionScope transaction = CreateTransactionScope())
    {
        args.Proceed();
        transaction.Complete();
    }
}
Run Code Online (Sandbox Code Playgroud)

导致以下错误:System.BadImageFormatException:尝试加载格式不正确的程序.(来自HRESULT的异常:0x8007000B)这似乎只发生在保存,而不是删除或获取调用的调用上.

我想知道是否有人遇到过类似的东西?

Joh*_*ell 1

是的,我遇到过这种情况。通常是 64/32 位问题。检查项目设置中的目标。