Site won't update \ postback

Topics: ASP.NET 2.0
Jan 11, 2008 at 9:56 PM
BE 1.3

Having a problem with the site and I don't know if it is IIS or BE coding. The site looks great and works great locally. We uploaded a local IIS server, created an application and everything "looks" fine. If I update the "site.master" file for the theme and re-upload no problem, everything comes through. The problem is the site is not re-building itself if I upload updates to the XML files and I can't log in to the site probably due to the same problem. It is like it is not running a postback, updating the application files, or reading the XML files. We have ASP.NET and NETWORK SERVICES set to full permissions with the App_data folder.

Any suggestions are greatly appreciated.
Jan 12, 2008 at 12:40 AM
What if you restart the application (pool) in IIS -after- you've updated .xml files? As far as I know, only then BE reloads the files in App_Data.

In case you can't restart the application directly (e.g. on an externally hosted IIS server), changing the web.config has the same effect. Even if it's just deleting 1 single character, re-adding it and saving or re-uploading the web.config.

But perhaps I'm not fully understanding your problem description?

Mike
Jan 12, 2008 at 6:35 PM
Correct, if I re-upload the entire site (including the "web.conf" file) to the IIS folder it will update! Does ASPNET and NETWORKSERVICES need read\write permission to the web.config file? How does BE update each time you make a post or login as ADMIN. Does it restart the application by editing something in the web.config file?

Sorry if these are dumb questions, I'm still trying to get my heard around ASP.NET.
Jan 12, 2008 at 9:04 PM
Edited Jan 13, 2008 at 3:34 PM
Please don't be sorry for asking any questions and I believe there is no such thing as dumb ones, only dumb answers so let me try to avoid those (keeping fingers crossed).

ASPNET and Network Services do not need write permissions to web.config for BE.NET to work (just read permissions).

Ok, now your interesting question about 'how BE.NET updates'. I'm not a developer or IIS expert, but here's my theory:
  • BE.NET runs in an IIS application pool (or basically is the application).
  • IIS allocates memory space on the server when the BE.NET application starts
  • ASP.NET/Network Service has exclusive access to this real-time memory
So if you make changes via BE.NET's admin interface (like adding posts, update settings) then:
  1. BE.NET saves the change to the .XML file in App_Data and 'tells' IIS to:
  2. Load this change directly into the application pool memory. Then:
  3. ASP/BE.NET/IIS serves from the updated application pool.
Done, all in real-time without an application restart.

If you change .XML files by hand, you basically bypass ASP.NET and the whole process above. Restarting the application will flush its memory and only then IIS loads your updates into the application pool. How you can force a restart, you'll find in my last post in this thread

Phew, did I make sense? At least I might have proved my opening statement ;-)

Mike
Jan 13, 2008 at 4:14 PM
Edited Jan 17, 2008 at 12:03 AM
Mike,

Thanks so much. I really appreciate your time. That makes sense; I was editing the XML files locally and uploading. The site was not triggered to read the XML files through this method, hence the problem. Now I know why and a fix that will hold me over until I figure out the real issue of logging into the site.

My login issue is what makes me edit the XML files locally. I can't log in to the site when it is running on IIS. The site is running as its own application on IIS but under a virtual directory. If I go to login, to accepts my ID and PASSWORD (no problems) but does not show me the Administration controls and doesn't switch the "Login" button to "Logout". Any ideas....?

Mark
Jan 17, 2008 at 12:28 AM
OK, after further troubleshooting the issue it seems to reside with a short coming in the BlogEngine (BE) code and it seems to relate to the post http://www.codeplex.com/blogengine/Thread/View.aspx?ThreadId=19592. In our situation we have multiple sites running under the "Default Web Site" in IIS. To have a clean URL to the different sites we used virtual directories so we did not have to include the host computer name, or IP address, in the URL to get to the different sites. This worked great except for the login part with BE.

We stepped back and followed the webcase at http://nyveldt.com/blog/post/BlogEngineNET-13-Installation-Screencast.aspx for how to setup BE and now everything seems to be working smoothly! The only drawback is we need to include the host name in the URL address to access BE and be able to login with Administration tool and be able to edit BE live. ie. http://iweb1/cad_channel

Hey, whatever….it is a lot easier to update the site now and we can live with using the host name in the URL if need be. If anyone knows a SIMPLE fix it would be much appreciated. If not….BlogEngine works great!

Mark