tags:

views:

91

answers:

2

When I make changes to a file, Mono ASP.NET doesn't see my changes, I have to do this:

sudo /etc/init.d/apache2 restart

I remember when Mono ASP.NET executes ASP.NET it caches the compilation somewhere. Before, when the updated page doesn't come up, I just delete that cached compiled code. I just forgot the exact path

How to make Mono ASP.NET detects the changes I made in program, without restarting the web server?

A: 

This is the command to restart your App, and recompile if its needed. (with out restart the web server).

Can you test it if do the work ?

HttpRuntime.UnloadAppDomain();

The other way is to create a file app_offline.htm on root, upload your changes, and then delete it.

Aristos
when i edit the aspx directly in Linux, Mono ASP.NET can fetch the updated page. but if the file is saved from Windows, Mono cannot detect that there are changes. by the way, the Mono ASP.NET is hosted in Vmwared Linux, asp.net source code is saved in windows drive. then that asp.net source code from windows is mounted directly to vmawred linux's /var/www/TestCode
Hao
@Hao, can you use the app_offline.html method ? and if this not work, you can create a hidden asp.net page, and just call it after your update, and this page just call the UnloadAppDomain. Logically, after that the Mono asp.net must detect and recompile the changes.
Aristos
i already tried that both before i replied to you, app_offline.html didn't work. i think it has something to do with linux's samba, it doesn't signal the other apps if the file was changed across the network. but if i edit the page(e.g. i put caption on aspx) directly(still on mounted samba folder) in linux, mono asp.net is able to display the updated page
Hao
@Hao can you please check the commnad UnloadAppDomain() ?
Aristos
+1  A: 

It sounds like the FileSystemWatcher cannot see changes coming from the windows side.

After you update on the windows side, go to the linux side and do:

touch Web.Config

or any file on the directory. This should notify ASP.Net to load your new code.

jpobst
thanks a ton, superb, that did the trick, even i modify AdminLogin.aspx and just touch Web.Config, it now loads the updated AdminLogin.aspx. though for AdminLogin.aspx.cs, must be compiled first(Ctrl+Shift+B) before touching Web.config so the updated code will be loaded
Hao
that's why i'm familiar with your ID, i have seen your april 1 blog about your ad-supported pinta before http://jpobst.blogspot.com/ nice opensource project
Hao