We are using PostSharp to inject caching functionality, we are only seeing this issue when we are using it. When we use Spring the issue seems to go away.
Any help would be appreciated as this, the issue is very difficult to replicate. I've included the stack trace below:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at System.Diagnostics.SymbolStore.SymWriter.CloseMethod() at System.Reflection.Emit.MethodBuilder.CreateMethodBodyHelper(ILGenerator il) at System.Reflection.Emit.TypeBuilder.CreateTypeNoLock() at System.Reflection.Emit.TypeBuilder.CreateType() at Castle.DynamicProxy.Generators.Emitters.AbstractTypeEmitter.BuildType() at Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateCode(Type[] interfaces, ProxyGenerationOptions options) at Castle.DynamicProxy.DefaultProxyBuilder.CreateClassProxy(Type theClass, Type[] interfaces, ProxyGenerationOptions options) at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type targetType, Type[] interfaces, ProxyGenerationOptions options, Object[] constructorArgs, IInterceptor[] interceptors) at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type targetType, Type[] interfaces, IInterceptor[] interceptors) at NHibernate.Proxy.Poco.Castle.CastleProxyFactory.GetProxy(Object id, ISessionImplementor session)