Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesquestion about the config component on the modulequestion about the config component on the module's installer (manifest .dnn file)
Previous
 
Next
New Post
3/24/2011 2:45 PM
 
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

 
New Post
3/24/2011 3:22 PM
 
Horacio

Usually we use configFile for uninstallation only. And all modifications make on first run of the module from within the module. In this way we can prevent hard exceptions like you described above. May be this can work for you too?

Sergey
 
New Post
3/24/2011 4:38 PM
 
The inclusion of a <location> element in the web.config is a known issue that similarly affects core updates such as the processing of the Net40.config file when .Net 4.0 is detected. There is a Gemini issue logged concerning that particular issue (DNN-14940) but as you have found a more generalized solution to catch the now unhandled null reference error and to then retry the web.config modification with location included in the XPath needs to be implemented in core XmlMerge code.

As for a fix in your case I don't see one that does not involve a core code change in either the installer or XmlMerge class or avoiding use of the config component in the manifest.

Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
3/25/2011 10:22 AM
 
Thanks for the replies, guys.

@Sergey: we also have configFile for uninstall items. It would fail too.
The problem with manually making the web.config updates on first run is that sometimes the site could go down (not load at all) if the web.config is not updated at module's install time, because there could be incompatible .dll files already running.

@William: I've added a comment (and linked to this post) on the Gemini issue.


Many thanks,
Horacio.-
 
New Post
3/25/2011 10:27 AM
 
Horacio

Thank you for your comment. In generally we did not have problems like you have described, but it has sense. Can you post here in case you find much better solution?

Thanks

Sergey
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesquestion about the config component on the modulequestion about the config component on the module's installer (manifest .dnn file)


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out