[CLOSED] Randomly Displaying Warning Message - The web.config file for this project is missing the required AjaxRequestModule

  1. #1

    [CLOSED] Randomly Displaying Warning Message - The web.config file for this project is missing the required AjaxRequestModule

    Hi, I am developing a project using Ext.Net.MVC / Razor engine since a months ago.
    Besides the very poor performance in the design mode of the views (.cshtml / razor) when using the components of the Ext.Net.MVC and some delay caused by the dynamic compilation of the views to be rendered in their first request, the application is running relatively well.
    The main problem is that the application is randomly (< 1% of requests) displaying the warning message:
    "The web.config file for this project is missing the required AjaxRequestModule."
    In addition, all the extjs generated script code rendered by Ext.Net is being displayed in the client browser.
    It appears that the message is being displayed when the application is in the phase of initialization, but it will not always occur and I cannot find a way to reproduce it.
    It is important to emphasize that the "DirectRequestModule" was/is configured in web.config by the installation of the Ext.Net package.
    What could be the cause and how can I prevent it?
    Is there another elegant way to treat this case (i.e. internal error 500) instead of displaying the script source code and a message to the end user?

    Best regards, thanks,

    Jos? Carlos.
    Last edited by Daniil; May 13, 2014 at 4:13 PM. Reason: [CLOSED]
  2. #2
    In addition, all the extjs generated script code rendered by Ext.Net is being displayed in the client browser.
    This is very strange. I don't ever remember running across this kind of problem before.

    I will discuss with the Dev Team and we'll get back to you with any questions.
    Geoffrey McGill
    Founder & CEO
  3. #3
    I feel it might be a problem with a host server.
  4. #4
    The main problem is that the application is randomly (< 1% of requests) displaying the warning message:
    "The web.config file for this project is missing the required AjaxRequestModule."
    Please update from SVN and retest, the issue should be fixed now

    Besides the very poor performance in the design mode of the views (.cshtml / razor) when using the components of the Ext.Net.MVC and some delay caused by the dynamic compilation of the views to be rendered in their first request, the application is running relatively well.
    Design mode is totaly inder VS control, Ext.Net doesn't execute any logic during design mode
    Vladimir Shcheglov
    Sr. Developer
  5. #5
    Quote Originally Posted by Vladimir View Post
    Please update from SVN and retest, the issue should be fixed now
    Hi Vladimir, sorry for the delay on the feedback, I didn't see your response.
    Anyway, I updated to the last version from the Nuget (2.5.1) some weeks ago. Is this release updated with this fix?
    I'm not certain on this but seems that the message about the web.config it is not displayed anymore but the issue about displaying the source code is still happening.
    I implemented an IExceptionFilter and could get the entire exception tracing message as below:
      <Type>System.ObjectDisposedException</Type>
      <Message>Cannot write to a closed TextWriter.</Message>
      <Source>mscorlib</Source>
      <StackTrace>   at System.IO.__Error.WriterClosed()
       at System.IO.StringWriter.Write(String value)
       at System.Web.HttpResponseWrapper.Write(String s)
       at Ext.Net.MVC.PartialViewResult.RenderScript(ControllerContext context, String script)
       at Ext.Net.MVC.PartialViewResult.RenderRazorView(ControllerContext context, RazorView razorView)
       at Ext.Net.MVC.PartialViewResult.ExecuteResult(ControllerContext context)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
       at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)</StackTrace>

    Seems that the Ext.Net is trying to write the script to a closed writer.

    Could you evalute this, please?

    Regards,

    Jose Carlos.
    Last edited by jcarlos; May 20, 2014 at 10:51 AM.
  6. #6
    Your stack trace shows that exception occurs inside PartialViewResult
    So, we need test case which demonstrates how do you work with PartialViewResult and that case should reproduce the issue
    Vladimir Shcheglov
    Sr. Developer
  7. #7
    Hi Vladimir, I don't know why this thread was closed.
    The view that is being rendered has many partial views that is conditionally rendered based on business rules.
    I checked the log of the exceptions with exactly this kind of occurrence, but it is very random, not specifically in a determined action/PartialViewResult.
    The exception seems to occurs only when the application is being started (in development machine) or at the first startup after the application was deployed/updated.
    A very simplified case of the scenario (not the real case due to its complexity) when the exception randomly occurs is the below.

    myController.cs:

    public partial class myController : Controller
    {
       public virtual ActionResult Index()
       {
    		Random r = new Random();
    
    		ViewResult viewResult = View(new MyModel());
    
    		viewResult.ViewBag.bDet2 = r.Next(2) == 0;
    		viewResult.ViewBag.bDet3 = r.Next(2) == 1;
    
    		return viewResult;
        }
    
    	public virtual ActionResult Det1(MyModel model, string containerId)
    	{
    		return new Ext.Net.MVC.PartialViewResult() { Model = model, RenderMode = RenderMode.AddTo, ContainerId = containerId };
    	}
    
    	public virtual ActionResult Det2(MyModel model, string containerId)
    	{
    		return new Ext.Net.MVC.PartialViewResult() { Model = model, RenderMode = RenderMode.AddTo, ContainerId = containerId };
    	}
    
    	public virtual ActionResult Det3(MyModel model, string containerId)
    	{
    		return new Ext.Net.MVC.PartialViewResult() { Model = model, RenderMode = RenderMode.AddTo, ContainerId = containerId };
    	}
    }
    index.cshtml:

    @model MyModel
    
    @{
        Layout = "~/Views/Shared/Master.cshtml";
    }
    
    @section myBody
    {
    	var X = Html.X();
    
    	var xPanel = X.Panel().Border(false).Layout(LayoutType.Fit);
    
    	xPanel.Items(X.Container().ID("Det1").ItemsFromAction("Det1", new { model = Model, containerId = "Det1" }));
    
    	if (ViewBag.bDet2)
    	{
    		xPanel.Items(X.Container().ID("Det2").ItemsFromAction("Det2", new { model = Model, containerId = "Det2" }));
    	}
    
    	if (ViewBag.bDet3)
    	{
    		xPanel.Items(X.Container().ID("Det3").ItemsFromAction("Det3", new { model = Model, containerId = "Det3" }));
    	}
    
    	// dozens of others conditional partial views here
    
    	@xPanel;
    }
    Last edited by jcarlos; May 02, 2014 at 2:57 AM.
  8. #8
    Please edit your previous posts and wrap all code samples in [CODE] tags.
    Geoffrey McGill
    Founder & CEO
  9. #9
    Thank you for wrapping the code in [CODE] tags. Please do that in the future as well. Actually, for exception stack traces as well.

    Anyway, I updated to the last version from the Nuget (2.5.1) some weeks ago. Is this release updated with this fix?
    Yes, it should contain the fix that Vladimir meant.

    I don't know why this thread was closed.
    There is a month and half between post #4 and #5. And post #4 was from our side. If no activity from a user for a while we close a thread. Though, please feel free to post any new info related to the initial topic.

    I checked the log of the exceptions with exactly this kind of occurrence, but it is very random, not specifically in a determined action/PartialViewResult.
    Random, but how often?

    Currently, we cannot reproduce the Exception.
  10. #10
    Vladimir Shcheglov
    Sr. Developer

Similar Threads

  1. Replies: 3
    Last Post: Jan 30, 2013, 1:34 PM
  2. Replies: 0
    Last Post: May 10, 2012, 1:33 AM
  3. Replies: 16
    Last Post: May 30, 2010, 1:13 AM
  4. Replies: 4
    Last Post: Oct 27, 2009, 6:15 AM
  5. Replies: 5
    Last Post: Jul 06, 2009, 3:02 PM

Tags for this Thread

Posting Permissions