griti
griti

Reputation: 650

Global.asax Application_start fired on every action

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 :)

Upvotes: 5

Views: 935

Answers (2)

Dmytrii Nagirniak
Dmytrii Nagirniak

Reputation: 24108

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.

Upvotes: 1

Darin Dimitrov
Darin Dimitrov

Reputation: 1039110

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.

Upvotes: 8

Related Questions