Visual Studio shows blank page when web application is run - asp.net

I've had an occasional issue with my laptop where the power instantly cuts out - without the machine shutting down properly. This happened a couple of times yesterday while I was working on a project in VS 2013. Since then when I try to run the project the browser loads and the name of the start up page appears in the url box but it just shows a blank page.
Before, the page loading icon in the Chrome tab would swirl for a while as it was loading, but now it hardly does that at all, as if it's not even trying to load the page.
Some extra info:
I tried setting a different starting page - same result.
I put a break point in the page load code - it doesn't get hit.
If I view the source of the blank it is completely empty, not even
tags
Other projects seem to work find still.
I'm using VS 2013 on Windows 7.
Tried deleting the temp asp.net files
(c/windows/microsoft.net/framework64/v4.0.30319/Temporary ASP.NET
Files) but curiously this folder is already empty - I'm sure this is
what I've done with problem projects before - although I've never
seen this particular problem.
I'm running on IISExpress and have tried all browsers and running without debugging with the same result.
Has anyone seen this problem before? Any ideas??
Thanks

I had the same problem. Solved it by adding a break point at Application_Error function in Global.asax.cs. Then I was able to see the real problem. It was because of some conflicting dlls.

I had the same problem as well. Suddenly when I launch my MVC web application from Visual Studio 2013, the browser comes up and the app is running, but the browser displays blank, no url and does not even try to load the page. In Visual Studio, none of the Script Documents are loaded either.
Simply by setting a breakpoint in Global.asax.cs, Application_start, everything went back to normal, problem solved.

Related

ASP viewstate always contains invalid characters

I'm having problems with one of our ASP websites when I try to run it locally.
The problems have appeared since my laptop crashed this afternoon. Since then the view state is always invalid. The cause is clear: Any time I visit the homepage and inspect the viewstate input tag in my webpage, it contains invalid characters which are displayed in firebug as a diamond with a question mark inside it. Whenever I submit the page, of course, I get an error screen.
Since then I've tried the following:
Restart my laptop
Delete the temporary ASP files folder
Stop/Start IIS
Recycle the application pool
Remove the website from IIS, delete all the source code, check out the source code from TFS, and rebuild the solution
The website does run fine on my colleague's PC with the same source code.
If anyone has any suggestions, please let me know!
EDIT: It happens to TWO of the websites I'm trying to run.
All the others I try run correctly

IIS express suddenly not displaying web page

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

Page in aps.net is not loading at all

I have a website project developed using Telerik's rad controls and Twitter's bootstrap in VS2010 (framework 4). I must say it is a large project and this problem was not there a couple of days ago. Problem is that I have few asp.net web pages under a particular folder which when requested to open on localhost, browser is in the loading state forever but page is not getting loaded. Earlier these pages were getting loaded without any problem whatsoever. And when I publish them on the IIS server, they work without any issue means there is no problem with the code.
I tried to debug on the Page_Load of code behind but I realized that server is never reaching there and I wonder what is causing this issue. I would also say that I had not changed any settings on OS or VS. I tried to copy the same page to an another folder to see if it works there but no luck. So folder does not seems to be any issue.
Any idea would be greatly appreciated as this is driving me crazy.
Thanks
Nailed it down, finally:) Infinite loop was messing up, Exit While did the trick.

Why does Web developer built-in web server serve zero byte files suddenly?

Visual Web Developer 2010 Express. C#, MVC3.
Clicking F5 to debug.
It starts up the built-in ASP web server on http://localhost:50188/
The Output window tells me WebDev.WebServer40.EXE is loading loads of DLLs.
Up until yesterday it worked. Today all URLs give me a blank page!
All controllers (all that changed yesterday was one controller, and some of its views; but it was working yesterday after all those changes). Same results in two different browsers. Use a different port gives an error (Telling me that there is something listening on port 50188!!) No errors anywhere. Just 0 byte files received.
My question is What happened and how do I fix it?
More Info:
Rebooting the machine made no difference.
I also found the obj/Debug directory and deleted it. It got recreated next time I hit F5 to debug. Still exactly the same problem!
And I went back 24hrs, in git, and still the same problem. So I'm sure the problem is not being caused by any of my source files. (The .csproj file is in git too.)
Look for a file called app_offline.htm (in your web root directory). It is a zero byte file. If it exists then this is served instead of any of your content! (It is a great feature if you wanted to take your site down for maintenance - put a custom message in that file.)
The Fix: Simply delete it and your website starts working again!
It appears (and I'm not sure about this) that the file is put there automatically when both you and your website want to access the DB at the same time. It should be deleted again automatically. But I guess a crash of something might leave it behind.
(To be honest, I think it would have been much wiser to put some content in app_offline.htm, explaining what it is and why it was automatically created. Quietly creating a zero-byte file is a tad sadistic...)
More information here: Why does app_offline.htm keep appearing in my web project?
And here: http://www.daniweb.com/web-development/aspnet/threads/215912/why-app_offline.htm-is-created-automatically-whats-the-mystery#

Visual Studio | ASP.NET Configuration error

I have a problem as I have struggled with for a week.
Now I give up! I really can not figure out how to solve it. Every time I open the ASP.NET Configuration in VS10, then comes the first with this error:
**An error was encountered. Please return to the previous page and try again. **
If I then press:
How do I Use this Tool
so this comes up:
**Tool Has Timed Out
As a security measure, the Web Site Administration Tool times out after a period of inactivity. Changes to machine.config or web.config may also result in the tool needing to be restarted. To continue configuring your web site, restart the tool. **
Some who can answer me on what's happening here?
"Special characters in the path may be the problem, according to the posts." as Posted above by Dave Swersky
THIS worked perfectly for me! I had a special character ("#") in my folder path I removed this and removed spaces for good measure!
I was getting the error "Tool has timed out" among other errors when accessing the WSAT(Web site administration tool) from the ASP.NET configuration menu item.
I saw a post somewhere else that said the problems was solved when the default browser was changed to Internet Explorer. I have been using Firefox and have the exact same problem. When I changed the default browser to IE, the configuration page came up with no problem. But it won't work twice in a row without going in and setting the default browser back to IE each time. When I go back in to Program Access and Defaults, "Use by current browser" is selected. I have to reselect IE, and then it will work one time.
Judging by the Connect site, this error has been reported and is not well understood:
http://connect.microsoft.com/VisualStudio/feedback/details/118567/an-error-was-encountered-please-return-to-the-previous-page-and-try-again
Special characters in the path may be the problem, according to the posts.
This is what worked for me.
I'm using Visual Studio 2010 trying to create the membership role. I was trying to use the ASP.NET Configuration in Visual Studio.
Set the 'Default Browser' to Internet Explore.
To do this:
Right click on one of the .aspx pages you have under "Solution Explorer".
Select "Browse With..."
Select Internet Explore and Click on Set as Default.
Close the box.
Go back and click on "ASP.NET Configuration"
This will automatically open Internet Explorer.
Problem Solved :D
I guess what I was doing wrong was using Firefox as the default browser with Visual Studio. I'm guessing Visual Studio works good together with Internet Explorer since Momma and Daddy made them together (awww how cute)
The issue might be related to an application path that has spaces. After googling I managed to bypass the issue by appending the application path to the url manually ie.
http://localhost:{your_port_here}/asp.netwebadminfiles/default.aspx?**applicationPhysicalPath={path_to_your_application}&applicationUrl=/**
As a firefox user, I closed firefox then executed the "ASP.NET Configuration" option in VS2010. It automatically opens firefox (default browser) and now I am seeing WAT page contents.

Resources