HighTechTalks DotNet Forums  

Input caching within Global.asax

Dotnet XML microsoft.public.dotnet.xml


Discuss Input caching within Global.asax in the Dotnet XML forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #31  
Old   
=?Utf-8?B?ZG91Zw==?=
 
Posts: n/a

Default RE: Input caching within Global.asax - 08-22-2007 , 10:02 AM






That certainly explains it. Thank you.

doug

"WenYuan Wang [MSFT]" wrote:

Quote:
Hello Doug,
Thanks for your reply.

I did trouble shoot the whole day and figured out the root case.

The Server.MapPath call use the following code to return the correct path
context.Request.MapPath(path);

The context object is not available because this object is only available
when ASPNET process an ASPX page. When the page an ASPX page is unloaded,
the context object is deleted.

In your case, this website is not always used. The aspx page will be
unloaded if there is no request for long time. So, there is no context
object when GlobalAsax.RefreshCache_M calls MapPath().

"Server operation is not available in this context." exception was thrown.

To resolve this issue, I suggest you write the absolute file path in
Web.config file, rather than call MapPath() method in FillCach_M method.

Would you please try this method and let me know if this resolves the
issue. I'm glad to assist you.
Have a great day.
Best regards,

Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.



Reply With Quote
  #32  
Old   
=?Utf-8?B?ZG91Zw==?=
 
Posts: n/a

Default RE: Input caching within Global.asax - 08-22-2007 , 12:16 PM






Replacing MapPath with physical path hard coded and the Application_error
path did not get invoked.

"WenYuan Wang [MSFT]" wrote:

Quote:
Hello Doug,
Thanks for your reply.

I did trouble shoot the whole day and figured out the root case.

The Server.MapPath call use the following code to return the correct path
context.Request.MapPath(path);

The context object is not available because this object is only available
when ASPNET process an ASPX page. When the page an ASPX page is unloaded,
the context object is deleted.

In your case, this website is not always used. The aspx page will be
unloaded if there is no request for long time. So, there is no context
object when GlobalAsax.RefreshCache_M calls MapPath().

"Server operation is not available in this context." exception was thrown.

To resolve this issue, I suggest you write the absolute file path in
Web.config file, rather than call MapPath() method in FillCach_M method.

Would you please try this method and let me know if this resolves the
issue. I'm glad to assist you.
Have a great day.
Best regards,

Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.



Reply With Quote
  #33  
Old   
=?Utf-8?B?ZG91Zw==?=
 
Posts: n/a

Default RE: Input caching within Global.asax - 08-22-2007 , 12:16 PM



Replacing MapPath with physical path hard coded and the Application_error
path did not get invoked.

"WenYuan Wang [MSFT]" wrote:

Quote:
Hello Doug,
Thanks for your reply.

I did trouble shoot the whole day and figured out the root case.

The Server.MapPath call use the following code to return the correct path
context.Request.MapPath(path);

The context object is not available because this object is only available
when ASPNET process an ASPX page. When the page an ASPX page is unloaded,
the context object is deleted.

In your case, this website is not always used. The aspx page will be
unloaded if there is no request for long time. So, there is no context
object when GlobalAsax.RefreshCache_M calls MapPath().

"Server operation is not available in this context." exception was thrown.

To resolve this issue, I suggest you write the absolute file path in
Web.config file, rather than call MapPath() method in FillCach_M method.

Would you please try this method and let me know if this resolves the
issue. I'm glad to assist you.
Have a great day.
Best regards,

Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.



Reply With Quote
  #34  
Old   
WenYuan Wang [MSFT]
 
Posts: n/a

Default RE: Input caching within Global.asax - 08-23-2007 , 03:56 AM



Hello Doug,
Thanks for your reply.

It seems the issue has gone away now.
Anyway, I'm standing by. Let me know if you notice the issue occurs again.
We are glad to assist you. Have a great day,

Best regards,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
  #35  
Old   
WenYuan Wang [MSFT]
 
Posts: n/a

Default RE: Input caching within Global.asax - 08-23-2007 , 03:56 AM



Hello Doug,
Thanks for your reply.

It seems the issue has gone away now.
Anyway, I'm standing by. Let me know if you notice the issue occurs again.
We are glad to assist you. Have a great day,

Best regards,
Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.