PDA

View Full Version : [CLOSED] Random Ext.Net.Mvc Razor Issues / NuGet Deployment



jcarlos
May 19, 2014, 3:21 PM
Hi, recently I complained about a random exception that can be checked in this thread: Randomly Displaying Warning Message - The web.config file for this project is missing the required AjaxRequestModule (http://forums.ext.net/showthread.php?29461-CLOSED-Randomly-Displaying-Warning-Message-The-web-config-file-for-this-project-is-missing-the-required-AjaxRequestModule)
The exception in the Ext.Net was occurring randomly when the application was starting.
Other case of random exception that was ocurring randomly is the 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(Control lerContext context, String script)


The application uses Asp.Net MVC5 and Ext.Net.MVC / Razor pages with a lot of partial views and conditional component items that are rendered conditionally (partial views and also items are conditionals), based on business rules, something as the little sample below and the issue occurs randomly in any of these partial views without any specific pattern.



@model MyModel

@{
Layout = "~/Views/Shared/Master.cshtml";
}

@section myBody
{
var X = Html.X();

var xPanel = X.Panel().Border(false).Layout(LayoutType.VBox);

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" }));
}

xPanel.Items(
X.Container()
.Layout(LayoutType.HBox)
.Items(
X.DisplayFieldFor(s => s.FieldA).Width(200).LabelWidth(100)),
X.DisplayFieldFor(s => s.FieldB).Width(200).LabelWidth(100))
)
);

if (ViewBag.bShowFieldC)
{
xPanel.Items(
X.Container()
.Layout(LayoutType.HBox)
.Items(
X.TextFieldFor(s => s.FieldC).Width(200).LabelWidth(100))
)
);
}

xPanel.Items(
X.Container()
.Layout(LayoutType.HBox)
.Items( items=> {
if (ViewBag.bShowFieldD)
items.Add( X.TextFieldFor(s => s.FieldD).Width(200).LabelWidth(100)) );

if (ViewBag.bShowFieldE)
items.Add( X.TextFieldFor(s => s.FieldE).Width(200).LabelWidth(100)) );
})
);


// dozens of others conditional partial views and conditional component items here

@xPanel;
}

The issue is still occurring and checking your SVN log, I could see the following revision: 5724 - [FIX] Ext.Net.MVC can be unstable (raise an exception) under Razor.

I don't know what kind of the exception was addressed by this revision by yours, but I was suspecting this could have a chance to be the case.

The interesting thing is that even with your last updated version performed directly by NuGet, in my case the issue was not solved and so I cannot prove my suspect.

Investigating a little more the thread http://forums.ext.net/showthread.php?32101-CLOSED-ExtNet-GridPanel-unhandled-exception-after-update-from-release-2-4-to-2-5 that I opened before, when I asked whether the assembly version updated by NuGet was the right version because the assembly was indicating as 2.5.0 and you answered that could be a cache issue in my side, I decided to download today again the Ext.Net.MVC directly from the URL https://www.nuget.org/api/v2/package/Ext.Net.MVC/2.5.1 and through the NuGet Package Explorer, I confirmed the exact same version (2.5.0.31282) that was being downloaded from NuGet Manager in the VS2012.

To double check, I also downloaded the package Ext.Net directly from the URL https://www.nuget.org/api/v2/package/Ext.Net/2.5.1 and checked from the explorer and confirmed that the version is different: 2.5.1.24988.

So, to conclude, the release version number that you deployed to Ext.Net.MVC does not have the same release version number as the Ext.Net.

I know that their contents is different, but my doubt is that the Ext.Net.MVC package that was deployed by you would be using a older source code version than the package Ext.Net.

Could it be the reason of the issues that I am still experiencing.

Could you please inform if these different versions numbers of these libraries are using the same source code?

If the source code is different, do you have any plan to deploy the right release number of the Ext.Net.MVC?

And also, could you inform what kind of issues was solved by your revision 5724 in the SVN?

Best regards, thanks,

geoffrey.mcgill
May 19, 2014, 4:31 PM
I will check the release numbers on all the NuGet packages today.


And also, could you inform what kind of issues was solved by your revision 5724 in the SVN?

Just look up the commit using Tortoise, then do a Diff on the code. That will show you exactly what code was changed.

jcarlos
May 19, 2014, 6:27 PM
Hi Geoffrey, thanks for your response.


Just look up the commit using Tortoise, then do a Diff on the code. That will show you exactly what code was changed.

Actually I already did that, but what I would like to know is the kind of scenario that it is being addressed by these modifications.

Additionally, after your checking the deployments, could you inform if the source code of the package Ext.Net.MVC deployed was really outdated?

Best regards,

Jose Carlos.

geoffrey.mcgill
May 19, 2014, 6:51 PM
Additionally, after your checking the deployments, could you inform if the source code of the package Ext.Net.MVC deployed was really outdated?

Only the .dll's in the Ext.NET.MVC NuGet packages are out of date. The .dll's included in the .zip downloads (http://ext.net/download/) are correct.

For some reason the .dll's for the NuGet MVC packages didn't get copied.

I will be fixing today.

Daniil
May 20, 2014, 6:03 AM
Actually I already did that, but what I would like to know is the kind of scenario that it is being addressed by these modifications.


The scenario which caused this failure message:

"The web.config file for this project is missing the required AjaxRequestModule."

It could happen if many requests occurs at the same time. Maintaining an HtmlHelper reference in a different way helped.

This exception

Cannot write to a closed TextWriter.
we could not reproduce. So, we need to reproduce it. If you can guide us how to reproduce, it would be a big step in solving that problem.

Vladimir
May 20, 2014, 9:36 AM
Hi,

I noticed that you use Ext.Net.MVC.PartialViewResult for views which are loaded by ItemsFromAction
Please switch to standard System.Web.Mvc.PartialViewResult class like in following sample
http://mvc.ext.net/#/Items/Action/

Frankly, I tried to reproduce the writer issue with System.Web.Mvc.PartialViewResult (just did not notice that you use Ext.Net class)

Ext.Net.MVC.PartialViewResult is designed to handle ajax request to render view to response

jcarlos
May 20, 2014, 1:50 PM
I noticed that you use Ext.Net.MVC.PartialViewResult for views which are loaded by ItemsFromAction
Please switch to standard System.Web.Mvc.PartialViewResult class like in following sample
http://mvc.ext.net/#/Items/Action/

Frankly, I tried to reproduce the writer issue with System.Web.Mvc.PartialViewResult (just did not notice that you use Ext.Net class)

Ext.Net.MVC.PartialViewResult is designed to handle ajax request to render view to response

Ok, I changed the code as per your suggestion that is really much more easy.

I am going to followup the logs with these changes this week and after that I will let you know the results, thank you.

Jose Carlos.

jcarlos
May 20, 2014, 2:00 PM
we could not reproduce. So, we need to reproduce it. If you can guide us how to reproduce, it would be a big step in solving that problem.

Ok, I am really suspecting that these two issues can be related to the fix that you already made and was not deployed in the NuGet combined to my misuse of the Ext.Net.MVC.PartialViewResult that Vladimir observed and suggested me to change.

Now I just compiled with current source code downloaded from SVN and also applyed the changes suggested by Vladminir in the PartialViewResult.

I am going to followup the logs with these changes this week and after that I will let you know the results, thank you.

Jose Carlos.

Daniil
May 28, 2014, 5:25 AM
@jcarlos, I am marking the thread as closed, but please feel free to post your feedback anyway.

jcarlos
Jun 19, 2014, 12:27 AM
Hi, just to give you a feedback about the issues that I reported and followed up in these last weeks.

The issues was totally solved with the fixes that you made in revision 5724 and also the modifications that you suggested in my code, changing from Ext.Net.MVC.PartialViewResult to the standard System.Web.Mvc.PartialViewResult.

Thank you very much by your support, it was really giving me a big headache and now it is running well.

Best regards,

Jose Carlos.

Daniil
Jun 19, 2014, 5:06 AM
Thank you for the feedback. It is nice to hear that everything is good now.