I've just migrated to a new dev machine, and when I launch my ASP.NET application, it starts fine, including Session_Start being called, and displays the WebForms login form (legacy, I know). But as soon as I click anywhere on that webpage, iisexpress terminates with exit code -1 (0xffffffff). It seems to skip both Session_End and Application_End, as no output is generated in the Output panel, from my System.Diagnostics.Debug.WriteLine(...) calls.
Any idea what might be happening or how I can research it? I'm unable to find anything useful on the web.
Update 2018-05-17:
The problem has vanished.
Yesterday, after posting, I tried some options: Disable debug and continue, change to use Chrome rather than FF, start option changed from "current page" to "specific page" (index page) or "start URL" (also index page). The problem vanished.
This morning, I tried resetting those options to what I think they were originally, but am unable to reproduce the problem.
So, I can only assume there was some temporary problem on my system.
Related
we've had a production application in use for about 7 years, and recently it started some strange behavior. There are a few pages where, when a user clicks a button that causes a postback and some proecessing, the browser looks like it's doing something (that is, the processing icon starts churning), but then it stops and all form data that the user enters disappears. The request never makes it to the server - I see no trace of it in the IIS logs.. no error gets written to the event log, and there are no javascript errors. It just starts and then stops. It only happens to certain users and it's not repeatable... the same user can use the same page again and it works and fails randomly. I can't reproduce the error. The browser being used is the latest Internet Explorer. I am a seasoned asp.net developer and have never seen this before.. I never ask a question in here, but this time i'm completely stumped because there is no trace of anything happening so I can't debug. Has anybody seen anything like this before?
Perhaps someone can help me figure out what's going on.
I'm running VS 2013 and working on a Web Forms application (not an MVC app). I'm using the templates that came down, including all the cool FriendlyUrls functionality. I've been working on this website for several weeks without any problem.
Today, for no apparent reason, one of my pages stopped working. When I attempted to view it, I got an error message that the server was not configured to list directories. My web page does not attempt to list the contents of any directory. It just has some images and some relatively simple Javascript (which does not attempt to enumerate anything).
The error message suggested I run the following command in the IIS Express directory:
appcmd set config /section:system.webServer/directoryBrowse /enabled:true
Just for the sake of experimenting, I ran that command. Now when I attempt to view the page, I get something that looks like this (the page is named Menus.aspx)
localhost - /Menus/
[To Parent Directory]
Clicking on "To Parent Directory" takes me to the home page, as one might expect.
I created a new page, Menus2.aspx, and copied all of the code from Menus.aspx into Menus2.aspx, and Menus2 runs fine. In addition, when I upload the site to Azure, Menus works correctly (as does Menus2). So I think my code is innocent of any wrongdoing.
I then deleted Menus.aspx and renamed Menus2.aspx to Menus.aspx, and I'm back to the same problem.
I was working in a git branch, and reverted back to master to see if at least my original configuration would work, but now even in master I can't get the page to come up.
So it looks like the problem is that something got jacked up in my local configuration, but I can't for the life of me figure out what it is. I have exited VS and rebooted the machine in hopes that the problem will disappear as mysteriously as it started, but no luck.
Every other page in the site (6 so far) works fine. It's just this one, with this name.
So my options at this point are to simply not have a page named Menus.aspx in my project because the name has somehow become cursed, or do all of my testing by uploading to the server and seeing how it works up there, which is a pain and should not be necessary.
Can someone suggest how and where I should start looking for what happened here? This isn't the problem I expected to be working on today.
Thanks in advance.
-Rob
I have the strangest problem! I have an ASP.NET website application (luckily not yet live). Yesterday and everyday before, I could run the application without error. It was working fine when I turned the computer off late last night. When I ran the application today, I got a strange message telling me that my website was offline and that I should remove the app_offline.htm page from my root directory to put it back online.
I have never seen this message or page before, so I searched online to find that apparently SQL Server can put it there temporarily while it's busy to stop any more incoming requests (or something similar). Its proper use is to stop requests going to your site when you are updrading or doing maintenance. I proceeded to remove it as suggested. I cleaned and built the solution and then tried to run it. It no longer runs.
Now, I get an error in my MasterPage code behind where I normally access the controls on the MasterPage in the Page_Load event handler (shown below).
protected void Page_Load(object sender, EventArgs e)
{
breadCrumb.BreadCrumbs = BreadCrumbs;
header.MenuItems = MenuItems;
footer.Footers = Footers;
head.Controls.Add(CreateCssLink("~/Stylesheets/main.css", "screen"));
head.Controls.Add(CreateJavaScriptLink("~/Scripts/site.js"));
if (Context.Session != null && Session["layout"] == null) Session["layout"] = "single";
if (!ArePreferencesVisible) preferences.Visible = false;
}
I want to be clear here... there are no errors in this code. There are correctly named elements in the MasterPage that correspond to those in this code. It has always worked as expected up until today and I have not changed any code since it was last working. I now get a NullReferenceException on the first line because the breadCrumb element is null. In fact, all the elements from the page that are referenced here are null.
Normally the page elements have been initialised by the time the Page_Load event is raised. What can have caused this to stop happening?
I have double checked that the MasterPage and its code behind file are still connected and they are. I also tried moving this code to the Page_LoadComplete event handler, but the controls had still not been initialised, even at that stage. I shouldn't really have to change the code because it worked just fine before.
I also commented out this code and the website ran, albeit without any styles. Interestingly, when I returned the original code to the event handler and refreshed the page, it actually worked again just as it used to. I loaded a number of different pages successfully and I thought it had fixed itself, so I restarted the application and then got the same error again. No amount of cleaning, building, changing solution configuration or restarting the application and Visual Studio make any difference.
I'm not sure if the app_offline.htm is a red herring, but I've never seen that before either so it might be connected somehow. From what I read, it seems that just removing it causes the server to restart the application domain automatically, so I can't see the connection.
I really hope someone has come across this bizarre situation before because I'm all out of ideas and I can't run my website until this is fixed.
Ok, so I finally tracked down the problem. I had an earlier backup of the website from a few days ago, so I loaded that up and it worked, albeit missing the last few days' work. I copied the latest project code into the Visual Studio > Projects folder leaving the old code in the Visual Studio > Website folder. I loaded the solution and it ran fine again.
I basically compared the Website files, updating each one in turn and periodically running the application. Eventually, the application stopped working. The last file that I had updated was a MasterPage file that extended the MasterPage that had the problem.
What I had done was comment out an empty Page_Load event handler in the MasterPage. I don't understand why that would cause this problem, so any comments explaining that would be helpful and appreciated.
This MasterPage is only used on the home page and a few others, so that explains why I didn't come across the problem the night that I changed it. (I hadn't viewed any pages that used that MasterPage after making the change). I wish I had because it would have been much easier to track down then, but such is life.
So I replaced all of my latest code, added the empty Page_Load event handler in the MasterPage again and finally, everything is working again.
I'm using asp.net and when I press the play button to start debugging, all works fine. The page I'm debugging makes ajax calls to a web service. Then, I press stop. When I trigger another call from the page in the browser, I get an error back.
Am I getting this error because something broke in the back-end (but since I stopped debugging I can't see what it it) or is it that when you press the stop button, the entire application stops? The reason I'm asking is that when I press the preview button on the same page, the ajax calls work fine even thought the app in not being debugged.
Thanks,
Try to look at the process explorer to see which process is starting/ending when you press "start/stop debug".
If the back end is yours and you've got source codes, than start another Visual Studio instance and run the backend in the debug mode to see what's happening there...
I am currently developing a silverlight application, however yesterday I started getting the following error message every time I run the project:
I am a little confused as to why I am getting this message, and am looking for some help to track down the cause. If I click "yes" to debug - nothing happens. Also, I have no Line 1805 in any of my source files!
This error message started appearing yesterday, and appears as soon as I run the project, shortly before the first page loads. If i click yes or no, the project then loads and runs perfectly, I cannot see any unwanted behaviour.
I have been using source control, so I rolled back the project to a point before the error started appearing, however I am still getting the error!
Could it be a setting in VS Web Developer Express 2010 that I have accidentally changed?
You have script debugging enabled in your IE advanced settings. If you don't intend to be debugging script then disable it. The line number represents the line in HTML or Javascript content file where the error is being reported.
Thanks for the answer Anthony, however I just solved the issue.
I cleared the browser cache, and now the error has gone away. How bizarre!