MVC :: ControllerActionInvoker First Chance HttpException?
Jul 14, 2010
For the heck of it, I decided to run my ASP.NET MVC 2 app in VS2010 with first chance exceptions enabled. I noticed a first chance exception in our custom ControllerActionInvoker. It appears to be non-fatal but seems to happen frequently. Concerned this could be slowing the web app down.
I am tryng to decide upon adding custom data to the ViewState dictionary by either deriving from ControllerBase or deriving from ControllerActionInvoker.
I am workining on a large site for a client. I have a control (an asp.net textbox) that is rendering with two class tags i.e.:<textarea class="x" class="y" />I have no idea how or why that is happening and I dont expect to find an answer here.however I hope that one of you can tell me the best way to debug it.I would like to see how that control is being by asp before any other code has a chance to modify it (the site uses telerik controls but the control in question is an asp.net textbox control).
When i fill my sql adapter daAuthors.Fill(dsPubs, "MYTable") sometime i get A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dllmy code can run for a lot hours without any problems but sometime i get the message
I'm working on a website powered by .NET asp/C# code. The clients require that sessions have a 25 minute timeout. However, sometimes the site is used, and a user stays connected for long periods of time (longer than 25 mins). Session_End is triggered:
The user returns some time later, but when they interact with the website, they get an error, and we get this email notification:
User: Unauthenticated User Error: System.Web.HttpException
Description: Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request...
The telling part of the stack trace is System.Web.UI.Control.AddedControl. Apparently, the server has thrown away the session data, and is sending new data, but the client is trying to deal with old data. Hence the error that "the control tree into which viewstate is being loaded [doesn't] match the control tree that was used to save the viewstate during the prevoius request."
So here's the question. How can I force instruct the user's browser to redirect to a "you're logged out" screen when the connection times out? (Is it something I should add to the Session_End method?)
I am developing a C#/SQL ASP.NET web application in VS 2008. Currently I am using the Server.Transfer method to transfer control from one ASPX.CS file to another ASPX file. The first time through, this works. But after control is transferred to this new file it encounters a condition:
if (restart == false) {
where "restart" is a boolean variable. After this statement it immediately transfers control back to the same ASPX.CS file and tries to reexecute the Server.Transfer method. This time it gives me the following exception and stack trace. Do you know what is causing this? I tried to read this but it didn't make much sense to me.
System.Web.HttpException was unhandled by user code Message="Error executing child request for DataMatch.aspx." Source="System.Web" ErrorCode=-2147467259 StackTrace: at System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm) at System.Web.HttpServerUtility.Transfer(String path, Boolean preserveForm) at System.Web.HttpServerUtility.Transfer(String path) at AddFileToSQL._Default.btnAppend_Click(Object sender, EventArgs e) in C:Documents and SettingsAdminMy DocumentsVisual Studio 2008ProjectsAddFileToSQLAddFileToSQLDefault.aspx.cs:line 109
I have a website(connect to active directory and pull the required details) deployed on the production web server and it is working fine from last one year.
But from last two days users are getting the following error frequently and find the error details below:-
how i can proceed on this error so that i will apply the fix in the webserver.
I ran into this error today and much googling didn't get me the answer. I have been for years now publishing this particular site by simply doing "Publish web site" and then supplying it a UNC path, then I go to the server delete the old bin and copy to the new bin folder to the live site, this has always worked except today I started getting the "cannot be requested" error for certian pages in certain directories. Everything else worked and after several attempts nothing else broke and only these same certain few pages where screwed up - there was nothing exciting about any of these pages, in fact they were part of the admin portion of the site and were very simple
I'm trying to return an error page indicating that the user couldnt be found and therefore I throw a HttpException with status code 404, however for some reason it wont redirect to the error page? - Is there some sort of trick to handle error pages with JSON that I should be aware of? My current code:
public ActionResult Details(int id) { User userToGet = _session.Query(new GetUserById(id)); if(userToGet == null) { throw new HttpException(404, "User not found"); } DetailsUserViewModel userToViewModel = AutoMapper.Mapper.Map<User, DetailsUserViewModel>(userToGet); return Json(new { HTML = RenderPartialViewToString("Partials/Details", userToViewModel) }, JsonRequestBehavior.AllowGet); }
We're having an issue with a .NET 3.5 WebForms site where occasionally our error logs start filling up with the following error message:
"Multiple controls with the same ID 'ctl09' were found. FindControl requires that controls have unique IDs."
I know very little about the exception as I have never seen it while debugging locally and have never caught it in the error logs soon enough to run a remote debugging session. I do know that an application pool recycle fixes the issue.
This only affects a single [high traffic] page in the site. The strange thing is that the site uses the pre-4.0 ID generation logic. So, when the page is working, there isn't an html element in the entire view source that isn't some autogenerated control ID prefix followed by a the 'actual' IDs (i.e. ctl09_someID_someOtherID).
What would case a control to randomly stop being built correctly? Other than the Global.asax, how can I trap this error and force the control to ... recompile? App pool to recycle?
I developed an asp.net mvc application. In one of my forms, I'm getting a following exception:
A public action method 'UpdateBasket' could not be found on controller 'App.Controllers.WebShopController'
But the funny thing is, that form submit works (even in debug mode) and finds an ActionMethod UpdateBasket and returns View. The problem is that because of that html generated error w3c validators and google crawlers can't access the site (I think so, correct me if I'm wrong).
I have a thread class which makes a web request. After 20-30 urls request, its throwing exception: System.Web.HttpException: Request timed out. My code is below where it is throwing exception:
This started as Could not load type 'Global' error. After I tried a few things and getting no where I deleted the Global.asax file and now the error is Could not load type '[namespace].???'Where ??? is the class name of every page I try to load.The web site (when executed within VS2008, local dev computer) works fine but once published (with no errors) and deployed to the server gives me Could not load type '[namespace].???' error
I did install elmah and I was able to get more details for this "generic" Could not load type '[namespace].???' error
elmah reports a HTTP error 500 :
System.Web.HttpException Could not load type '[namespace].???' -> System.Web.HttpParseException: Could not load type '[namespace].???'
I have checked the "basics"
References Doing a clean and a build Checking the Inherits attr in the HTML against the code behind
UPDATE #1 I did deploy the site to a different DEV computer (configured IIS, virtual folder, etc.) and it works. When I use the same published code on the server, get the generic Could not load type '[namespace].???' error
UPDATE #2 I created a test web app. One form (Default.aspx) with a button. The click event does a Response.Write("Hello World"); I moved this app to the server and guess what, I get the Could not load type TestSite._Default
UPDATE #3 According to the fusion log viewer, these two websites are attempting to load CppCodeProvider and VJSharpCodeProvider, but I have no references to any of these. After a Google search, I found this post.I checked and I have no references to JAVA files.
I've got the problem with a simple e-mail form, it uses the simple.aspx and ASPEMAILLib.dll from the persits aspemail installation.The application is hosted on IIS 7, the application pool is a .NET 1.1. I followed the guide on http://blogs.iis.net/bills/archive/2008/06/02/installing-asp-net-1-1-with-iis7-on-vista-and-windows-2008.aspx
I am using Asp.net 3.5. In my application I am handling errors at application level in Global.asax. I am using 3rd party control FpSpread in my application. In all the pages where I've that control, it's throwing "File does not exist" error when first time postback occurs in IE (on every postback in FF). From the log I got following Details:
04/01/2010 11:32:18 : The error description is as follows : [URL] Type- System.Web.HttpException Message- File does not exist. Stack Trace- at System.Web.StaticFileHandler.GetFileInfo(String virtualPathWithPathInfo, String physicalPath, HttpResponse response) at System.Web.StaticFileHandler.ProcessRequestInternal(HttpContext context) at System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) Targetsite- System.IO.FileInfo GetFileInfo(System.String, System.String, System.Web.HttpResponse)
It is trying to refer wrong URL because my css is in App_Themes/Blue directory and my page is in /Forms/Company directory. Has anyone encountered similar issue before?? Is this the issue related to theme?? I am not trying to load any images programmatically.
This bug is very difficult to troubleshoot. I run 4 apps on the same server, all 4 are clones from the first one, just differ on their database connection. 2 run perfectly, but on two of them, when making a postback from a certain page, by clicking a button or by changing a datagrid page, it throws this error:
I get an HttpException (details below) after installing Visual Studio 2010 Pro RTM in an application developed using Visual Studio 2010 RC. The platform used was ASP.NET MVC2 RTW (already under VS10 RC).
I first uninstalled all RC software and even ASP.NET MVC 2, and then did a "clean" install of VS10 RTM. The ASP.NET MVC 2 version now installed on my dev machine is 2.0.50217.0.
Exception Message: Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'.
InnerException Message: <FilePath>ViewsLanguageRenderLanguageNavigation.ascx(6): error BC30451: 'Model' is not declared. It may be inaccessible due to its protection level.
The error occurs on this "Html.RenderAction":
[Code]....
The "LanguageController" just calls into another service function as below:
[Code]....
Does anybody have an idea what is causing the problem?
Edit:
By the way, I might also share the actual view (partial view) that would show the languages to select from: