1

我们正在使用 PostSharp 注入缓存功能,我们只在使用它时才看到这个问题。当我们使用 Spring 时,问题似乎消失了。

任何帮助将不胜感激,因为这个问题很难复制。我在下面包含了堆栈跟踪:

尝试读取或写入受保护的内存。
这通常表明其他内存已损坏。
System.AccessViolationException:试图读取或写入受保护的内存。这通常表明其他内存已损坏。

在 System.Diagnostics.SymbolStore.SymWriter.CloseMethod()
在 System.Reflection.Emit.MethodBuilder.CreateMethodBodyHelper(ILGenerator il)
在 System.Reflection.Emit.TypeBuilder.CreateTypeNoLock()
在 System.Reflection.Emit.TypeBuilder.CreateType()
在 Castle.DynamicProxy.Generators.Emitters.AbstractTypeEmitter.BuildType()
在 Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateCode(Type[] 接口,ProxyGenerationOptions 选项)
在 Castle.DynamicProxy.DefaultProxyBuilder.CreateClassProxy(键入 theClass,Type[] 接口,ProxyGenerationOptions 选项)
在 Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(类型 targetType,Type[] 接口,ProxyGenerationOptions 选项,Object[] constructorArgs,IInterceptor[] 拦截器)
在 Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(类型 targetType,Type[] 接口,IInterceptor[] 拦截器)
在 NHibernate.Proxy.Poco.Castle.CastleProxyFactory.GetProxy(对象 id,ISessionImplementor 会话)
4

2 回答 2

2

我有类似的问题,我通过配置解决了:应用程序池->高级设置->“启用 32 位应用程序”为 True

重新启动 IIS 和网站。

于 2015-05-14T14:53:45.907 回答
1

I've seen a similar recurring problem with the project I'm working on, which makes heavy use of Rhino Mocks.

It happens in .NET 3.5 on 64-bit machines when mocking a large number of different interfaces.

The .NET 4.0 beta doesn't seem to have this problem.

于 2010-02-24T21:09:50.987 回答