[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.caching

AccessViolationException using HttpRuntime.Cache on Server2008/IIS

Matt Davis

9/5/2008 4:09:00 PM

I am trying to deploy our ASP.NET web application to a new Windows Server
2008 machine. The transition to IIS7 is proving problematic for the ISAPI
filter that is part of our application pipeline. We have the application
pool set to use the 2.0 framework, classic pipeline, and allow 32-bit
applications.
The problem starts when our ISAPI filter attempts to use the
HttpRuntime.Cache from System.Web.Caching, the error follows:

System.AccessViolationException: Attempted to read or write protected
memory. This is often an indication that other memory is corrupt.
at System.Web.Hosting.UnsafeIISMethods.MgdGetSiteNameFromId(UInt32
siteId, IntPtr& bstrSiteName, Int32& cchSiteName)
at
System.Web.Configuration.ProcessHostConfigUtils.GetSiteNameFromId(UInt32
siteId)
at System.Web.Configuration.ProcessHostServerConfig..ctor()
at System.Web.Configuration.ProcessHostServerConfig.GetInstance()
at
System.Web.Caching.CacheMemoryPrivateBytesPressure.ReadConfig(CacheSection
cacheSection)
at System.Web.Caching.CacheCommon.ReadCacheInternalConfig(CacheSection
cacheSection)
at System.Web.HttpRuntime.get_Cache()
at MyApplication.CacheManager.get_Instance() in
\MyApplication\CacheManager.cs:line 20
at MyApplication.CacheManager.Add(String key, Object value,
CacheDependency dependency) in \MyApplication\CacheManager.cs:line 25
at MyApplication.CreditUnions.set_CreditUnionsCache(Dictionary`2 value)
in \MyApplication\CreditUnions.cs:line 62
at MyApplication.CreditUnions.Load() in
\MyApplication\CreditUnions.cs:line 90
Does anyone have ideas on what I can do to resolve this error? Any ideas on
where to look?

Thanks,
Matthew M. Davis

2 Answers

Alvin Bruney [ASP.NET MVP]

9/12/2008 1:37:00 AM

0

I believe server 2008 and IIS7 run in 65bit mode by default. 32 bit
applications need to be configured appropriately. Try this:
%windir%\system32\inetsrv\appcmd set config -section:applicationPools
-applicationPoolDefaults.enable32BitAppOnWin64:true


--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Download OWC Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $15.00
Need a free copy of VSTS 2008 w/ MSDN Premium?
http://msmvps.com/blogs/alvin/De...
-------------------------------------------------------


"Matt Davis" <Matt Davis@discussions.microsoft.com> wrote in message
news:4DC44A7C-65A1-48C4-AE95-F8D2EE8C23CE@microsoft.com...
> I am trying to deploy our ASP.NET web application to a new Windows Server
> 2008 machine. The transition to IIS7 is proving problematic for the ISAPI
> filter that is part of our application pipeline. We have the application
> pool set to use the 2.0 framework, classic pipeline, and allow 32-bit
> applications.
> The problem starts when our ISAPI filter attempts to use the
> HttpRuntime.Cache from System.Web.Caching, the error follows:
>
> System.AccessViolationException: Attempted to read or write protected
> memory. This is often an indication that other memory is corrupt.
> at System.Web.Hosting.UnsafeIISMethods.MgdGetSiteNameFromId(UInt32
> siteId, IntPtr& bstrSiteName, Int32& cchSiteName)
> at
> System.Web.Configuration.ProcessHostConfigUtils.GetSiteNameFromId(UInt32
> siteId)
> at System.Web.Configuration.ProcessHostServerConfig..ctor()
> at System.Web.Configuration.ProcessHostServerConfig.GetInstance()
> at
> System.Web.Caching.CacheMemoryPrivateBytesPressure.ReadConfig(CacheSection
> cacheSection)
> at System.Web.Caching.CacheCommon.ReadCacheInternalConfig(CacheSection
> cacheSection)
> at System.Web.HttpRuntime.get_Cache()
> at MyApplication.CacheManager.get_Instance() in
> \MyApplication\CacheManager.cs:line 20
> at MyApplication.CacheManager.Add(String key, Object value,
> CacheDependency dependency) in \MyApplication\CacheManager.cs:line 25
> at MyApplication.CreditUnions.set_CreditUnionsCache(Dictionary`2 value)
> in \MyApplication\CreditUnions.cs:line 62
> at MyApplication.CreditUnions.Load() in
> \MyApplication\CreditUnions.cs:line 90
> Does anyone have ideas on what I can do to resolve this error? Any ideas
> on
> where to look?
>
> Thanks,
> Matthew M. Davis
>

Matt Davis

9/16/2008 8:40:00 PM

0

Yes, I had 32-bit applications enabled for the AppPool.

"Alvin Bruney [ASP.NET MVP]" wrote:

> I believe server 2008 and IIS7 run in 65bit mode by default. 32 bit
> applications need to be configured appropriately. Try this:
> %windir%\system32\inetsrv\appcmd set config -section:applicationPools
> -applicationPoolDefaults.enable32BitAppOnWin64:true
>
>
> --
>
> Regards,
> Alvin Bruney [MVP ASP.NET]
>
> [Shameless Author plug]
> Download OWC Black Book, 2nd Edition
> Exclusively on www.lulu.com/owc $15.00
> Need a free copy of VSTS 2008 w/ MSDN Premium?
> http://msmvps.com/blogs/alvin/De...
> -------------------------------------------------------
>
>
> "Matt Davis" <Matt Davis@discussions.microsoft.com> wrote in message
> news:4DC44A7C-65A1-48C4-AE95-F8D2EE8C23CE@microsoft.com...
> > I am trying to deploy our ASP.NET web application to a new Windows Server
> > 2008 machine. The transition to IIS7 is proving problematic for the ISAPI
> > filter that is part of our application pipeline. We have the application
> > pool set to use the 2.0 framework, classic pipeline, and allow 32-bit
> > applications.
> > The problem starts when our ISAPI filter attempts to use the
> > HttpRuntime.Cache from System.Web.Caching, the error follows:
> >
> > System.AccessViolationException: Attempted to read or write protected
> > memory. This is often an indication that other memory is corrupt.
> > at System.Web.Hosting.UnsafeIISMethods.MgdGetSiteNameFromId(UInt32
> > siteId, IntPtr& bstrSiteName, Int32& cchSiteName)
> > at
> > System.Web.Configuration.ProcessHostConfigUtils.GetSiteNameFromId(UInt32
> > siteId)
> > at System.Web.Configuration.ProcessHostServerConfig..ctor()
> > at System.Web.Configuration.ProcessHostServerConfig.GetInstance()
> > at
> > System.Web.Caching.CacheMemoryPrivateBytesPressure.ReadConfig(CacheSection
> > cacheSection)
> > at System.Web.Caching.CacheCommon.ReadCacheInternalConfig(CacheSection
> > cacheSection)
> > at System.Web.HttpRuntime.get_Cache()
> > at MyApplication.CacheManager.get_Instance() in
> > \MyApplication\CacheManager.cs:line 20
> > at MyApplication.CacheManager.Add(String key, Object value,
> > CacheDependency dependency) in \MyApplication\CacheManager.cs:line 25
> > at MyApplication.CreditUnions.set_CreditUnionsCache(Dictionary`2 value)
> > in \MyApplication\CreditUnions.cs:line 62
> > at MyApplication.CreditUnions.Load() in
> > \MyApplication\CreditUnions.cs:line 90
> > Does anyone have ideas on what I can do to resolve this error? Any ideas
> > on
> > where to look?
> >
> > Thanks,
> > Matthew M. Davis
> >