Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 20th, 2004, 07:05 PM
Authorized User
 
Join Date: Aug 2003
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default file monitoring

I have an ASP.NET app that clients can run to make certain changes to an XML document stored on the server.

If I run the app as a client, close the app, make changes to the XML document manually, and then run the app again, my asp.net app doesn't register the changes in the XML document until I make some changes to the web config file to restart the application server.

Is it because I am loading the xml document in the application state? Does that mean that the app would not load xml from disk until the first hit after timeout? (I could be totally wrong there: Is there a timeout associated with application state like sessionstate?)

How can I make the application load the latest changes to the xml between subsequent runs? Some kind of dependency between the document in the application state and the document on the disk perhaps?

Thanks,
any and all help will be appreciated.
 
Old May 23rd, 2004, 06:24 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Instead of loading the XML document into the application state, use the web cache. When you insert an object into the web cache you can insert with a dependency. The dependencies can be date/time, file, other dependencies, etc. So you would create a file dependency against that XML file so when it's changed outside the web application itself the cached version will expire and be forced to reload. The other benefit of this is that in the web application you don't need to have code that saves TO the xml file also reload it into the cache. Just let the cache load code (which checks to see if the object is already cached) handle the (re)load which it has to do anyway.

Look into the System.Web.Caching namespace.

Peter
-------------------------
Work smarter, not harder





Similar Threads
Thread Thread Starter Forum Replies Last Post
Monitoring DrPurdum BOOK: Beginning C# 3.0 : An Introduction to Object Oriented Programming ISBN: 978-0-470-26129-3 8 November 25th, 2008 06:37 AM
I'm still monitoring this forum... .MAttButler BOOK: Professional Web Parts and Custom Controls ASP.NET ISBN: 0-7645-7860-X 0 September 26th, 2006 10:50 PM
Monitoring gangeles VB.NET 0 May 22nd, 2006 09:38 AM
COM+ Monitoring using COMSVCSLib bappelt VB Components 2 August 1st, 2005 10:39 AM
Monitoring files rylemer Pro VB 6 5 June 20th, 2003 10:13 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.