Any way to programatically modify the URL mappings in the web.config without restarting the asp work

  • Thread starter Thread starter justin
  • Start date Start date
J

justin

I have the problem that I need to programatically add new url mappings to
the web.config file in an asp 2.0 app.

e.g. my code is

Dim urlMappings As UrlMappingCollection = urlMappingSection.UrlMappings
Dim url_Mapping As UrlMapping

Dim y As New UrlMapping("~/myalias", "~/article.aspx?SectionID=45")

urlMappings.Add(y)

If Not urlMappingSection.IsReadOnly() Then
configuration.Save()
End If

This works fine, however as the web.config file has been modified the asp
worker process restarts and all users of the website lose their session
variables etc.

Is there any way round this? Is there any in memory version of web.config
that I can modify?

Thanks

Justin
 
Nope.
anytime the web.config is modified the site/applicaiton will restart. Store
these in another place perhaps.
 
Back
Top