具有动态代理生成的 System.AccessViolationException

发布于 2024-08-08 08:57:35 字数 1347 浏览 9 评论 0原文

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

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

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)

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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦在夏天 2024-08-15 08:57:35

我遇到了类似的问题,我通过配置解决了:
应用程序池 ->高级设置 ->“启用 32 位应用程序”以真正

重新启动 IIS 和网站。

I was having similar probelm which I resolved by configuring:
Application Pools -> Advanced Setting ->'Enable 32-Bit Applications' to True

Restart IIS and WebSite.

缘字诀 2024-08-15 08:57:35

我在我正在从事的项目中看到了类似的反复出现的问题,该项目大量使用了 Rhino Mocks。

在 64 位计算机上的 .NET 3.5 中,当模拟大量不同的接口时,会发生这种情况。

.NET 4.0 beta 似乎没有这个问题。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文