6

I am currently setting up a production environment and I keep running into exceptions thrown while the site is initializing, due to configuration/patching issues. The fact that I can't load the ShowConfig is slowing me down and I would be able to troubleshoot and fix these issues a lot faster if I could only see it. Is there any way for me to do this?

14

You can use the Sitecore Config Builder tool which is available on the Marketplace.

Sitecore Config Builder

Select the web.config for the solution and then choose where to save the resulting merged config file. This is the same result as you would see if you browsed to /sitecore/admin/showconfig.aspx but it does not require a working Sitecore instance, just the config files. This is extremely useful if you want to see final patched config for a production instance from backups or without having to set it up locally for exmaple.

The Config Builder tool is also installed and accessible if you have Sitecore Instance Manager installed:

Sitecore Instance Manager

  • Very cool! So this actually installs on the actual machine, as opposed to the instance? – Zachary Kniebel Nov 1 '16 at 19:48
  • 1
    @ZacharyKniebel: It's just a few files, you can put it on a USB stick if you want, no install required. You can copy it up to the PROD instance or just copy the PROD config files down locally and run it there. – jammykam Nov 1 '16 at 19:51
  • That's reeeeeeeeeally cool! I would upvote again, if I could! – Zachary Kniebel Nov 1 '16 at 19:52
6

You can get the value of the fully patched Sitecore config by updating your Global.asax file to the following:

<%@Application Language='C#' Inherits="Sitecore.Web.Application" %>
<script runat="server">
protected void Application_Start()
{
    System.IO.File.WriteAllText("<website_root>\\App_Data\\sitecore.config", Sitecore.Configuration.Factory.GetConfiguration().OuterXml);
}
</script>

This tells the application to write the fully patched Sitecore config to the \App_Data folder of your site's webroot. You can, of course, change this location to one of your choice.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.