More in this section

Forums / Developing with Sitefinity / Sitefinity attempts to modify incorrect web.config

Sitefinity attempts to modify incorrect web.config

6 posts, 0 answered
  1. Pete
    Pete avatar
    20 posts
    Registered:
    24 Mar 2009
    15 Apr 2009
    Link to this post
    I've run in to a bit of a peculiar issue.  I have installed Sitefinity on a virtual directory/independent application within an existing IIS site.

    In my case, I have a parent url of:

    http://mysite.com

    Sitefinity has been installed as a virtual directory configured to use it's own application pool here:

    http://mysite.com/sf

    Everything works perfectly EXCEPT uploading controls.  It appears that instead of referencing "~/web.config", the platform is trying to access just "/web.config".  Naturally that points to the root of the site which is actually http://mysite.com/web.config as opposed to ~/web.config which would point to http://mysite.com/sf/web.config.

    I am still able to deploy controls manually by modifing the toolboxControls element, but I'd like to tell Sitefinity to please stop modifying web.config files it has no business touching.
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    15 Apr 2009
    Link to this post
    Hello Pete,

    Have you stopped the web.config inheritance?
    I haven't tried the scenario yet, but in this case, you should tell that the parent web.config should not be inherited by the child application. Otherwise the child system will interpret the settings from the parent web.config file, will merge them in one file and parse them in the memory. Then, it will populate the settings in the memory, and try to flush them to the permanent storage.

    Please take a look at Stopping web.config inheritance. In short, you should add the following line in the parent web.config file:
    <location path="." inheritInChildApplications="false">

    If you already have this node, then you should only add the attributes.

    Please let me know if this fixes the behavior, if not, I will test it locally and give you another suggestion.

    Best wishes,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Pete
    Pete avatar
    20 posts
    Registered:
    24 Mar 2009
    15 Apr 2009
    Link to this post
    I have placed the location element on the web.config of the Sitefinity installation.  This was necessary to allow the virtual directory to run under full trust as the "parent" iis site must run in low/medium trust and I saw no reason to propogate that attribute.

    Is it necessary to set this element in the parent site in order for Sitefinity to resolve properly?  Note that "~/path/to/resource/ DOES properly resolve to http;//mysite.com/sf/path/to/resource.
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    20 Apr 2009
    Link to this post
    Hello Pete,

    In this case, you should place
    <location path="." inheritInChildApplications="false">

    in the parent application web.config file, and not in the Sitefinity one, because Sitefinity is the child application. If you place this in the parent application, Sitefinity should not run in medium trust as well, but in the trust level set in the machine.config. Still, you could tell <trust level="Full"> in the Sitefinity web.config file, in case there is a problem with this.

    Kind regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Pete
    Pete avatar
    20 posts
    Registered:
    24 Mar 2009
    20 Apr 2009
    Link to this post
    Georgi,

    I'll give that a try.  All of my research indicates that placing the location element in a web.config affects everything beginning with breaking inheritance of the current application and propagating down.  I would like to reiterate that "~/" IS PROPERLY RESOLVING to http://mysite.com/mySubSite/.  Also, elevating trust to full IS PROPERLY FUNCTIONING with my current configuration.

    With that in mind, I am inclined to believe the inheritInChildApplications attribute is functioning properly and there is a hard coded reference to "/" instead of "~/".

    Just the same, I will put in a request to place the inherit attribute in the default website just to be consistent.

    I'll let you know how it works out.
  6. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    22 Apr 2009
    Link to this post
    Hello Pete,

    I am now closing this thread, but feel free to open it when you have any results.

    Regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
6 posts, 0 answered