views:

242

answers:

2

I am working on a MVC project and the performance was fine.

On application_start the database gets indexed for the lucene.net search (and on every change on an object the index is extended). But application_start runs on every action I call on the page.

Why is it firing application_start not only once? I will post any code when I know where to look ;)

I'm not sure if the web.config may cause this behaviour...

Solution: Lucene.net wrote its index to the bin folder, after changing the path the application is not melting my face anymore :)

+5  A: 

It could be because when Lucene builds its index it modifies some of the files (web.config, global.asax, bin folder, etc...) that would cause AppDomain to unload.

Darin Dimitrov
In web.config there is nothing about lucene, but in the bin folder there is a folder named _indexes... maybe this is from lucene? The guy who set up lucene is gone (external programmer) and not available in the next two weeks.
griti
If the bin folder is modified the application will restart. You need to reconfigure Lucene to store its index elsewhere.
Darin Dimitrov
yep, found out where lucene is configured. thanks!
griti
+1  A: 

Most likely the web.config gets modified somehow.
To track it down try to set Read-Only attribute of the web.config and see if there are any errors.

Really the main place to look at is the web.config, possibly in sobfolders too.

Dmytrii Nagirniak
after the application started I set the web.config and the bin folder + subfolders to readonly and still application_start is called :(
griti