AccessViolationException

D

Danny Ni

Hi,

I need help with the following exceptions, it happens to my dev machine and
live server every now and then, most of the times they happen after I
recompile the solution on my dev machine or deploy the new assembly to live
server. TIA

Attempted to read or write protected memory. This is often an indication
that other memory is corrupt.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.AccessViolationException: Attempted to read or
write protected memory. This is often an indication that other memory is
corrupt.

Source Error:

[No relevant source lines]

Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\aspdotnetstorefront70\ba2e2abd\22b6879\App_global.asax.cth5fihf.0.cs
Line: 0

Stack Trace:

[AccessViolationException: Attempted to read or write protected memory. This
is often an indication that other memory is corrupt.]
ASP.global_asax..ctor() in
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\aspdotnetstorefront70\ba2e2abd\22b6879\App_global.asax.cth5fihf.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of an
invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean
publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle&
ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
fillCache) +103
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean
skipVisibilityChecks, Boolean fillCache) +268
System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder
binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+1036
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes) +114
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr
appContext, HttpContext context) +197
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance() +27
System.Web.HttpApplicationFactory.FireApplicationOnStart(HttpContext
context) +3460678
System.Web.HttpApplicationFactory.EnsureAppStartCalled(HttpContext
context) +125
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext
context) +99
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +350
 
M

Manish

Hi Danny,

Please make sure that you have ASPNET account read/write rights to your
Temporary ASP.NET files folder.

Regards,
Manish
www.componentone.com


Danny Ni said:
Hi,

I need help with the following exceptions, it happens to my dev machine and
live server every now and then, most of the times they happen after I
recompile the solution on my dev machine or deploy the new assembly to live
server. TIA

Attempted to read or write protected memory. This is often an indication
that other memory is corrupt.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.AccessViolationException: Attempted to read or
write protected memory. This is often an indication that other memory is
corrupt.

Source Error:

[No relevant source lines]

Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\aspdotnetstorefront70\ba2e2abd\22b6879\App_global.asax.cth5fihf.0.cs
Line: 0

Stack Trace:

[AccessViolationException: Attempted to read or write protected memory. This
is often an indication that other memory is corrupt.]
ASP.global_asax..ctor() in
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\aspdotnetstorefront70\ba2e2abd\22b6879\App_global.asax.cth5fihf.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of an
invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean
publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle&
ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
fillCache) +103
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean
skipVisibilityChecks, Boolean fillCache) +268
System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder
binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
+1036
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes) +114
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr
appContext, HttpContext context) +197
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance() +27
System.Web.HttpApplicationFactory.FireApplicationOnStart(HttpContext
context) +3460678
System.Web.HttpApplicationFactory.EnsureAppStartCalled(HttpContext
context) +125
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext
context) +99
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +350
 
M

Michael Nemtsev [MVP]

Hello Danny,

what's the type of asp.net project on your dev machine - file or IIS?!
Seems that IIS. Have u tried to restart IIS after you build new version of
your assembly and before running site on dev?!

if it doesnt help, try to remove everything from c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary
ASP.NET Files\

seems that IIS load your new assembly to others, which were not flushed and
new changed are not correcly used

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


DN> Hi,
DN>
DN> I need help with the following exceptions, it happens to my dev
DN> machine and live server every now and then, most of the times they
DN> happen after I recompile the solution on my dev machine or deploy
DN> the new assembly to live server. TIA
DN>
DN> Attempted to read or write protected memory. This is often an
DN> indication
DN> that other memory is corrupt.
DN> Description: An unhandled exception occurred during the execution of
DN> the
DN> current web request. Please review the stack trace for more
DN> information
DN> about the error and where it originated in the code.
DN> Exception Details: System.AccessViolationException: Attempted to
DN> read or write protected memory. This is often an indication that
DN> other memory is corrupt.
DN>
DN> Source Error:
DN>
DN> [No relevant source lines]
DN>
DN> Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary
DN> ASP.NET
DN> Files\aspdotnetstorefront70\ba2e2abd\22b6879\App_global.asax.cth5fih
DN> f.0.cs Line: 0
DN>
DN> Stack Trace:
DN>
DN> [AccessViolationException: Attempted to read or write protected
DN> memory. This
DN> is often an indication that other memory is corrupt.]
DN> ASP.global_asax..ctor() in
DN> c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
DN> Files\aspdotnetstorefront70\ba2e2abd\22b6879\App_global.asax.cth5fih
DN> f.0.cs:0
DN>
DN> [TargetInvocationException: Exception has been thrown by the target
DN> of an
DN> invocation.]
DN> System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean
DN> publicOnly, Boolean noCheck, Boolean& canBeCached,
DN> RuntimeMethodHandle&
DN> ctor, Boolean& bNeedSecurityCheck) +0
DN> System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
DN> fillCache) +103
DN> System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean
DN> skipVisibilityChecks, Boolean fillCache) +268
DN> System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
DN> System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr,
DN> Binder
DN> binder, Object[] args, CultureInfo culture, Object[]
DN> activationAttributes)
DN> +1036
DN> System.Activator.CreateInstance(Type type, BindingFlags
DN> bindingAttr,
DN> Binder binder, Object[] args, CultureInfo culture, Object[]
DN> activationAttributes) +114
DN>
DN> System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntP
DN> tr
DN> appContext, HttpContext context) +197
DN> System.Web.HttpApplicationFactory.GetSpecialApplicationInstance()
DN> +27
DN>
DN> System.Web.HttpApplicationFactory.FireApplicationOnStart(HttpContext
DN> context) +3460678
DN>
DN> System.Web.HttpApplicationFactory.EnsureAppStartCalled(HttpContext
DN> context) +125
DN>
DN> System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext
DN> context) +99
DN> System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest
DN> wr) +350
 
D

Danny Ni

Hi Michael,

I am using IIS, my solution contains one web project and 7 class libraries,
the browsers always call pages from the web project. You are right,
restarting IIS make the problems go away. But it happens to live server even
when none of the new assemblies are deployed, that's what worries me, what
if problems happen while I am sleeping?

Thanks Again


Michael Nemtsev said:
Hello Danny,

what's the type of asp.net project on your dev machine - file or IIS?!
Seems that IIS. Have u tried to restart IIS after you build new version of
your assembly and before running site on dev?!

if it doesnt help, try to remove everything from
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\

seems that IIS load your new assembly to others, which were not flushed
and new changed are not correcly used

---
WBR, Michael Nemtsev [.NET/C# MVP] :: blog:
http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

DN> Hi,
DN> DN> I need help with the following exceptions, it happens to my dev
DN> machine and live server every now and then, most of the times they
DN> happen after I recompile the solution on my dev machine or deploy
DN> the new assembly to live server. TIA
DN> DN> Attempted to read or write protected memory. This is often an
DN> indication
DN> that other memory is corrupt.
DN> Description: An unhandled exception occurred during the execution of
DN> the
DN> current web request. Please review the stack trace for more
DN> information
DN> about the error and where it originated in the code.
DN> Exception Details: System.AccessViolationException: Attempted to
DN> read or write protected memory. This is often an indication that
DN> other memory is corrupt.
DN> DN> Source Error:
DN> DN> [No relevant source lines]
DN> DN> Source File:
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary
DN> ASP.NET
DN> Files\aspdotnetstorefront70\ba2e2abd\22b6879\App_global.asax.cth5fih
DN> f.0.cs Line: 0
DN> DN> Stack Trace:
DN> DN> [AccessViolationException: Attempted to read or write protected
DN> memory. This
DN> is often an indication that other memory is corrupt.]
DN> ASP.global_asax..ctor() in
DN> c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
DN> Files\aspdotnetstorefront70\ba2e2abd\22b6879\App_global.asax.cth5fih
DN> f.0.cs:0
DN> DN> [TargetInvocationException: Exception has been thrown by the
target
DN> of an
DN> invocation.]
DN> System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean
DN> publicOnly, Boolean noCheck, Boolean& canBeCached,
DN> RuntimeMethodHandle&
DN> ctor, Boolean& bNeedSecurityCheck) +0
DN> System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
DN> fillCache) +103
DN> System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean
DN> skipVisibilityChecks, Boolean fillCache) +268
DN> System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
DN> System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr,
DN> Binder
DN> binder, Object[] args, CultureInfo culture, Object[]
DN> activationAttributes)
DN> +1036
DN> System.Activator.CreateInstance(Type type, BindingFlags
DN> bindingAttr,
DN> Binder binder, Object[] args, CultureInfo culture, Object[]
DN> activationAttributes) +114
DN> DN>
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntP
DN> tr
DN> appContext, HttpContext context) +197
DN> System.Web.HttpApplicationFactory.GetSpecialApplicationInstance()
DN> +27
DN> DN>
System.Web.HttpApplicationFactory.FireApplicationOnStart(HttpContext
DN> context) +3460678
DN> DN> System.Web.HttpApplicationFactory.EnsureAppStartCalled(HttpContext
DN> context) +125
DN> DN>
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext
DN> context) +99
DN> System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest
DN> wr) +350
 
M

Michael Nemtsev [MVP]

Hello Danny,

welll... u deploy nothing to production and you have the same error?!
but in your original post u wrote that it happens only after deployment'

after which actions you have such an error?!

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


DN> Hi Michael,
DN>
DN> I am using IIS, my solution contains one web project and 7 class
DN> libraries, the browsers always call pages from the web project. You
DN> are right, restarting IIS make the problems go away. But it happens
DN> to live server even when none of the new assemblies are deployed,
DN> that's what worries me, what if problems happen while I am sleeping?
DN>
DN> Thanks Again
DN>
DN> DN>
Hello Danny,

what's the type of asp.net project on your dev machine - file or
IIS?! Seems that IIS. Have u tried to restart IIS after you build new
version of your assembly and before running site on dev?!

if it doesnt help, try to remove everything from
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\

seems that IIS load your new assembly to others, which were not
flushed and new changed are not correcly used

---
WBR, Michael Nemtsev [.NET/C# MVP] :: blog:
http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high
and we
miss it, but that it is too low and we reach it" (c) Michelangelo
DN> Hi,
DN> DN> I need help with the following exceptions, it happens to my
dev
DN> machine and live server every now and then, most of the times
they
DN> happen after I recompile the solution on my dev machine or deploy
DN> the new assembly to live server. TIA
DN> DN> Attempted to read or write protected memory. This is often an
DN> indication
DN> that other memory is corrupt.
DN> Description: An unhandled exception occurred during the execution
of
DN> the
DN> current web request. Please review the stack trace for more
DN> information
DN> about the error and where it originated in the code.
DN> Exception Details: System.AccessViolationException: Attempted to
DN> read or write protected memory. This is often an indication that
DN> other memory is corrupt.
DN> DN> Source Error:
DN> DN> [No relevant source lines]
DN> DN> Source File:
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary
DN> ASP.NET
DN>
Files\aspdotnetstorefront70\ba2e2abd\22b6879\App_global.asax.cth5fih
DN> f.0.cs Line: 0
DN> DN> Stack Trace:
DN> DN> [AccessViolationException: Attempted to read or write
protected
DN> memory. This
DN> is often an indication that other memory is corrupt.]
DN> ASP.global_asax..ctor() in
DN> c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
DN>
Files\aspdotnetstorefront70\ba2e2abd\22b6879\App_global.asax.cth5fih
DN> f.0.cs:0
DN> DN> [TargetInvocationException: Exception has been thrown by the
target
DN> of an
DN> invocation.]
DN> System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean
DN> publicOnly, Boolean noCheck, Boolean& canBeCached,
DN> RuntimeMethodHandle&
DN> ctor, Boolean& bNeedSecurityCheck) +0
DN> System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
DN> fillCache) +103
DN> System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean
DN> skipVisibilityChecks, Boolean fillCache) +268
DN> System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
DN> System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr,
DN> Binder
DN> binder, Object[] args, CultureInfo culture, Object[]
DN> activationAttributes)
DN> +1036
DN> System.Activator.CreateInstance(Type type, BindingFlags
DN> bindingAttr,
DN> Binder binder, Object[] args, CultureInfo culture, Object[]
DN> activationAttributes) +114
DN> DN>
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntP
DN> tr
DN> appContext, HttpContext context) +197
DN> System.Web.HttpApplicationFactory.GetSpecialApplicationInstance()
DN> +27
DN> DN>
System.Web.HttpApplicationFactory.FireApplicationOnStart(HttpContext
DN> context) +3460678
DN> DN>
System.Web.HttpApplicationFactory.EnsureAppStartCalled(HttpContext
DN> context) +125
DN> DN>
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext
DN> context) +99
DN> System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest
DN> wr) +350
 
D

Danny Ni

Hi Michael,

Sorry about the verbiage misunderstanding. What I meant :

Most of the times(90%), the errors happen after I recompile the soluion on
my dev machine or I deploy the new assemblies to live server

On occasion ( the other 10%), the live server throw this exceptions with me
doing anything. I don't know what actions caused it, I only know it after it
happened, either someone told me or I found out by myself

Thanks

Michael Nemtsev said:
Hello Danny,

welll... u deploy nothing to production and you have the same error?!
but in your original post u wrote that it happens only after deployment'

after which actions you have such an error?!

---
WBR, Michael Nemtsev [.NET/C# MVP] :: blog:
http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

DN> Hi Michael,
DN> DN> I am using IIS, my solution contains one web project and 7 class
DN> libraries, the browsers always call pages from the web project. You
DN> are right, restarting IIS make the problems go away. But it happens
DN> to live server even when none of the new assemblies are deployed,
DN> that's what worries me, what if problems happen while I am sleeping?
DN> DN> Thanks Again
DN> DN>
Hello Danny,

what's the type of asp.net project on your dev machine - file or
IIS?! Seems that IIS. Have u tried to restart IIS after you build new
version of your assembly and before running site on dev?!

if it doesnt help, try to remove everything from
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\

seems that IIS load your new assembly to others, which were not
flushed and new changed are not correcly used

---
WBR, Michael Nemtsev [.NET/C# MVP] :: blog:
http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high
and we
miss it, but that it is too low and we reach it" (c) Michelangelo
DN> Hi,
DN> DN> I need help with the following exceptions, it happens to my
dev
DN> machine and live server every now and then, most of the times
they
DN> happen after I recompile the solution on my dev machine or deploy
DN> the new assembly to live server. TIA
DN> DN> Attempted to read or write protected memory. This is often an
DN> indication
DN> that other memory is corrupt.
DN> Description: An unhandled exception occurred during the execution
of
DN> the
DN> current web request. Please review the stack trace for more
DN> information
DN> about the error and where it originated in the code.
DN> Exception Details: System.AccessViolationException: Attempted to
DN> read or write protected memory. This is often an indication that
DN> other memory is corrupt.
DN> DN> Source Error:
DN> DN> [No relevant source lines]
DN> DN> Source File:
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary
DN> ASP.NET
DN>
Files\aspdotnetstorefront70\ba2e2abd\22b6879\App_global.asax.cth5fih
DN> f.0.cs Line: 0
DN> DN> Stack Trace:
DN> DN> [AccessViolationException: Attempted to read or write
protected
DN> memory. This
DN> is often an indication that other memory is corrupt.]
DN> ASP.global_asax..ctor() in
DN> c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
DN>
Files\aspdotnetstorefront70\ba2e2abd\22b6879\App_global.asax.cth5fih
DN> f.0.cs:0
DN> DN> [TargetInvocationException: Exception has been thrown by the
target
DN> of an
DN> invocation.]
DN> System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean
DN> publicOnly, Boolean noCheck, Boolean& canBeCached,
DN> RuntimeMethodHandle&
DN> ctor, Boolean& bNeedSecurityCheck) +0
DN> System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
DN> fillCache) +103
DN> System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean
DN> skipVisibilityChecks, Boolean fillCache) +268
DN> System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
DN> System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr,
DN> Binder
DN> binder, Object[] args, CultureInfo culture, Object[]
DN> activationAttributes)
DN> +1036
DN> System.Activator.CreateInstance(Type type, BindingFlags
DN> bindingAttr,
DN> Binder binder, Object[] args, CultureInfo culture, Object[]
DN> activationAttributes) +114
DN> DN>
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntP
DN> tr
DN> appContext, HttpContext context) +197
DN> System.Web.HttpApplicationFactory.GetSpecialApplicationInstance()
DN> +27
DN> DN>
System.Web.HttpApplicationFactory.FireApplicationOnStart(HttpContext
DN> context) +3460678
DN> DN>
System.Web.HttpApplicationFactory.EnsureAppStartCalled(HttpContext
DN> context) +125
DN> DN>
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext
DN> context) +99
DN> System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest
DN> wr) +350
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top