More in this section

Forums / Developing with Sitefinity / Exception in Templates Admin

Exception in Templates Admin

8 posts, 0 answered
  1. Nitin
    Nitin avatar
    51 posts
    Registered:
    14 Aug 2007
    07 Oct 2007
    Link to this post
    Hi.

    We recently moved our Sitefinity site dev environment from Win Xp to Vista and have started noticing some strange behavior. When we try to edit any of our templates, an exception is thrown:

     

    Server Error in Application "Default Web Site/ThinkwiseInc"


    HTTP Error 404.0 - Not Found

    Description: The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

    Error Code: 0x80070002

    Notification: MapRequestHandler

    Module: IIS Web Core

    Requested URL: http://localhost:80/ThinkwiseInc/baselayouttempate.template?cmspagemode=preview&locknavigation=true

    Physical Path: C:\Dev\ThinkwiseInc\baselayouttempate.template

    Logon User: Anonymous

    Logon Method: Anonymous

    Handler: StaticFile

    Most likely causes:

    • The directory or file specified does not exist on the Web server.
    • The URL contains a typographical error.
    • A custom filter or module, such as URLScan, restricts access to the file.

    What you can try:

    • Create the content on the Web server.
    • Review the browser URL.
    • Create a tracing rule to track failed requests for this HTTP status code and see which module is calling SetStatus. For more information about creating a tracing rule for failed requests, click here.

    More Information... This error means that the file or directory does not exist on the server. Create the file or directory and try the request again.


    Server Version Information: Internet Information Services 7.0.


    Shouldn't the Requested Url path in exception include App_Master too?

    Not only that, trying to remove templates using Sitefinity interface removes the master.cs file from App_Master folder as well. Per user manual, sitefinity should not deletes the master file for the templates.

    Thanks

    nG

  2. Gabe Sumner
    Gabe Sumner avatar
    440 posts
    Registered:
    09 Sep 2007
    08 Oct 2007
    Link to this post
    I'm getting this problem as well.  I reported this with the original 3.1 BETA and was told it has something to do with the IIS mappings to ".template" files.

    I never did get the problem resolved with the BETA.  Since I'm in a shared hosting environment I'm hoping the fix really doesn't require changes to IIS.

    Gabe
    ===============
  3. Nitin
    Nitin avatar
    51 posts
    Registered:
    14 Aug 2007
    08 Oct 2007
    Link to this post
    Gabe,

    We are using v3.0 SP2. Unfortunately, our client's web site will be hosted in shared environment as well (GoDaddy).

    It looks like one more issue that we we have to deal with. We already have had to disable workflow support as it won't run in medium trust level environment.

    And we can't make our use control properties to work that are decorated with
    "[WebEditor("Telerik.Cms.Web.UI.UrlEditorWrapper, Telerik.Cms")]" as a runtime security exception is thrown (again, a medium trust level hosting environment issue)

    It makes me wonder if Sitefinity sites should be hosted in dedicated server environments.

    nG
  4. Gabe Sumner
    Gabe Sumner avatar
    440 posts
    Registered:
    09 Sep 2007
    08 Oct 2007
    Link to this post
    Providing an Application Extension Mapping in IIS for ".template" files does appear to solve this problem.

    The settings are as follows:

    Executable: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
    Extension: .template
    Script Engine: CHECKED
    Check that file exists: UNCHECKED

    The executable will vary depending on the version of .NET you're using.  I have requested this mapping from DiscountASP.Net; we'll see how that goes.

    As another aside, I was testing this locally on my machine with Sitefinity 3.1 Community Edition.  Once I provided the mapping above, this worked.  However, if I attempted to upload a new master template, I got the following error:

    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    Object reference not set to an instance of an object.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

    Stack Trace:

    [NullReferenceException: Object reference not set to an instance of an object.]
       Telerik.Cms.Web.UI.PageEditorBase.OnPreRender(EventArgs e) +71
       System.Web.UI.Control.PreRenderRecursiveInternal() +77
       System.Web.UI.Control.PreRenderRecursiveInternal() +161
       System.Web.UI.Control.PreRenderRecursiveInternal() +161
       System.Web.UI.Control.PreRenderRecursiveInternal() +161
       System.Web.UI.Control.PreRenderRecursiveInternal() +161
       System.Web.UI.Control.PreRenderRecursiveInternal() +161
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360

    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

    If I ignore the error and reload the "Admin" web page everything seems to work fine.  I'm not sure where this error is coming from or why it seems to work just fine if I continue on.

    Gabe
    ================

  5. Gabe Sumner
    Gabe Sumner avatar
    440 posts
    Registered:
    09 Sep 2007
    08 Oct 2007
    Link to this post
    DiscountASP.Net already replied; and the mapping has been added.

    Hooray!  That was pretty easy. 

    Once a master template has been uploaded is there a way to reupload it (overwrite) it?  I'm probably overlooking something easy here. 

    Perhaps it would be best to just directly alter the preexisting master file?

    Gabe
    ===============
  6. Bob
    Bob avatar
    330 posts
    Registered:
    30 Dec 2016
    09 Oct 2007
    Link to this post
    Hi all,

    Let me explain ISAPI mappings and why they are necessary. ISAPI mappings tell the Internet Information Server how to direct requests for processing. In our case, we instruct that requests with file extensions “.template” and “.rss“ should be passed to ASP.Net for processing (there will be other extensions required in the future).

    In the web.config, we also specify HTTP handlers for those extensions. HTTP handlers are classes that actually serve the request. In the case of RSS request, for example, we do not need Page instance and that’s why we create our own handler to serve this kind of requests. Of course, we can do it with standard .aspx page and change the response accordingly but HTTP handlers provide more efficient and clear way for serving such requests. Besides, ISAPI mappings to aspnet_isapi.dll do not impose any security threats different from any standard ASP.Net request and should be supported by most hosting providers.

    Greetings,
    Bob
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. anand
    anand avatar
    59 posts
    Registered:
    11 Jun 2008
    19 Sep 2008
    Link to this post
    Hi,

    but we have deployed our project that uses Sitefinity's community server on IXWebshosting but they are not ready to add .tamplate, .rss. .sflb, .tmb extensions in ISAPI extensions in mappingin IIS,
    Can any one suggest how can I get rid of this problem,

    Thnaks,
    anand
  8. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    22 Sep 2008
    Link to this post
    Hi anand,

    unfortunately there is no work around this requirement. As Bob has stated these settings pose no security threat, therefore you may be best-off trying to ask your hosting provider once more to set these settings for you and if they refuse ask them for the reasons.

    You may send few inqueries to other ASP.NET hosting providers asking them would it be possible to map the named extensions and I am sure all of them will tell you that they would be glad to do that for you.

    I am sorry that your deployment process has been frustrating. Let us know if we can assist you in any way.

    Kind regards,
    Ivan
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
8 posts, 0 answered