Hello,
I'm using the config component to on the module's .DNN file to add/update configurations on the web.config file.
e.g. I have this:
<
component
type
=
"Config"
>
<
config
>
<
configFile
>web.config</
configFile
>
<
install
>
<
configuration
>
<
nodes
>
<
node
path
=
"/configuration/system.web/httpHandlers"
action
=
"update"
key
=
"path"
collision
=
"overwrite"
>
<
add
path
=
"ChartImage.axd"
type
=
"Telerik.Web.UI.ChartHttpHandler"
verb
=
"*"
validate
=
"false"
/>
</
node
>
<
node
path
=
"/configuration/system.webServer/handlers"
action
=
"update"
key
=
"name"
collision
=
"overwrite"
>
<
add
name
=
"ChartImage_axd"
verb
=
"*"
preCondition
=
"integratedMode"
path
=
"ChartImage.axd"
type
=
"Telerik.Web.UI.ChartHttpHandler"
/>
</
node
>
...
This works fine on most installations.
The problem is when someone has a not-standard DNN web.config file, e.g. when they have this:
<location inheritInChildApplications="false">
<system.web>
.....
</system.web>
</location>
In this case, the install crashes with an ExceptionSystem.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Services.Installer.XmlMerge.UpdateNode(XmlNode rootNode, XmlNode
actionNode) in C:\Builds\Maintenance\WorkingDirectory\Library\Services\Installer\XmlMerge.vb:line 340 at....
Questions:
1) Can I update somehow the .DNN code find above to avoid this crash? That is, ignore the configuration change request, if the path is not found (e.g. "/configuration/system.web/httpHandlers")?
2) Can I add an additional
conditional configurations, to be able to update the target web.config files also when the path is like /configuration/location/system.web/httpHandlers (or whatever it could be)?
Thanks,
Horacio.-
PS: Info about the config component could be found here: http://www.dotnetnuke.com/Resources/Wiki/tabid/1409/Page/Manifest-Component-Installers-The-Config-Component/Default.aspx