What could cause "Connection Interrupted" on LocalHost when debugging in ASP.NET - c#

I'm trying to run a freshly created ASP.NET Website using C#, however when I do so it launches FireFox and attempts to connect to http://localhost:1295/WebSite1/Default.aspx (for example), but after about 10-15 seconds it displays a "Connection Interrupted - The connection to the server was reset while the page was loading." Error.
This issue is also present with older ASP.NET C# pages/Web Services I've built in the past, nothing is actually running off the ASP.NET Development server.
I am using: Windows XP Pro SP2, Visual Studio 2008
For reference I have SQL Server 2005 Developer Edition installed as well.
I have tried:
Browsing it with IE instead of Mozilla
Trying 2.0 framework instead of 3.5
Reinstalling Visual Studio 2008
This problem seems so trivial the more I think about it, but I havn't been able to work it out just yet! Appreciate any help on the matter.

I had the same problem, and when I was about to quit and run away and join a monastry I had an idea to check ELMAH - maybe it had caught it...
Sure enough, ELMAH told me it had caught this:
System.Web.HttpException (0x80004005): Maximum request length exceeded.
and this fixed it:
<system.web>
<httpRuntime maxRequestLength="65535" />
</system.web>
Good luck,
Dave

When you launch the application, a little info mark appears at the right bottom of your screen telling you that the local web server was started and on wich port. You should compare that port to the one that appears in your browser. If they are different, an anti-virus could be responsible for that problem.
Another place to look is your host file. Some software tweak this file and can make your localhost disbehave.

Something like Fiddler or another proxy like server could cause this issue if local addresses are proxied.
You can check this under Control Panel/Internet Options - Connections Tab, Click LAN Settings down the bottom.

Try adding "127.0.0.1 localhost" before the line reading "::1 localhost"
in c:\windows\system32\drivers\etc\hosts
This worked for me (VS2008, Vista Ultimate)

I had a similar problem on Windows 7 RC and Visual Studio 2008 SP1. Changing localhost to 127.0.0.1 helped. Similar to the hosts file solution, but doesn't require the file editing, you just need to change the project startup url.

I've the same problem, just instaled VS 2008 in a Vista Business machine. I have a LAN, but no proxy server and the c:\windows\system32\drivers\etc\hosts" with "127.0.0.1 localhost" are there. but none of my projects work, neither new ones.

"I had a similar problem on Windows 7 RC and Visual Studio 2008 SP1. Changing localhost to 127.0.0.1 helped. Similar to the hosts file solution, but doesn't require the file editing, you just need to change the project startup url."
This solution is working fine.......

Related

Website works on visual studio 2017 but not IIS 10

I have a asp.net web application that I am trying to deploy to IIS on Windows Server 2016. I first ran the application on Visual Studio 2017 and it loads and runs perfectly fine but on IIS when I run it on localhost it loads up but with the code headers on it and no functionality.
There are no errors thrown from the browser perspective or event logs so I don't know how to troubleshoot specifically. Most of the research I have done on this issue points to not having HTTP activation feature enabled but I have installed everything and still this issue has not been resolved. Most of the suggestions and answers I have tried were for the old IIS 7.5 or 8 not IIS 10.0 which I am using. The application runs fine on visual studio so I'm guessing that it is not a problem with the code but with my IIS configuration. I'm hoping someone can help me or at least point me in the right direction. This is my first question ever so I'm not sure what else is needed (i.e code, specifics) for me to get a proper answer. I will provide what is needed. Thank you
Thanks for your comments guys. After searching for solutions using the framing of the question as "IIS not serving ASPX files" I found a solution which worked which was to go IIS -> select your website -> go to handler mapping and then press revert to parent option. Apparently my handler mapping for the website were incorrect or not configured properly but everything works now. Thanks for your help.

asp.net mvc web app is not running on defined port in IIS express 10.0

I am working on asp.net mvc web application project in visual studio 2015 with .NET framework 4.5. it was configured to run over ssl port 44302. i had to format my OS. After re-installing everything. it changed to run over other port. when i try to change port manually now it is not working. i re-installed iis express. deleted ssl and using netsh.
still can't able to make it work on port 44302. when i set this to port 44302. iis express does not start it. i am worried if i need to re-install OS or can i solve this.
please have a look in picture>
The "override application URL" checkbox isn't checked so the URL isn't being overridden.
visual studio 2017 localhost didn't send any data under SSL.
I found that the proxy setting for localhost had been hi-jacked by a video downloader program. Went to network settings > proxy and turned it off. Suddenly working!!

Handler "ExtensionlessUrlHandler-Integrated-4.0" has a bad module "ManagedPipelineHandler" in its module list

To be honest, I've tried to turn a dirty trick on IIS and just when I thought that I was going to get away with it, I realized my workaround doesn't work. Here's what I've tried to do:
1) I have ASP.NET application which has Preloader class that inherits IProcessHostPreloadClient and does all the heavy initialization in Preload method implementation (application is complex and it's a part of an enormous system, so it requires approximately 2 minutes to establish connections to all necessary services and pre-instantiate some Unity registrations).
2) I have a lot of work that needs to be done on application shutdown (unsubscribing, disconnecting, disposing,...), and I guess the best place to do it is in *Application_End* method located in Global.asax.
3) Everything works just fine when I have user activity (first request after the Application Pool that contains aforementioned web application is started will cause *Application_Start* to be called and afterwards *Application_End* is called on Application Pool stop or recycle), but problems occur when there is no user activity and application tries to restart itself after being active for 48 hours (configured requirement). Since there was no requests, application officially didn't get started. Ergo, it can't be gracefully stopped since *Application_End* won't be called.
4) Now comes the messy part... I've tried to make a GET request from code at the end of the Preload method, and it worked. But this solution seemed bad to me, even though it worked. So, I've tried a lot of things, and the last thing I tried was this:
SimpleWorkerRequest swr = new SimpleWorkerRequest(string.Empty, string.Empty, tw);
HttpRuntime.ProcessRequest(swr);
... and that has done it's purpose. *Application_Start* was called, (I've checked response, it was containing login page that was supposed to be displayed in initial request) and on Application Pool shutdown application ended gracefully by doing necessary work in *Application_End*.
BUT
After the application was started (preloaded and initiated) in this manner, this is what happened when I wanted to reach application via Web browser:
HTTP Error 500.21 - Internal Server Error
Handler "ExtensionlessUrlHandler-Integrated-4.0" has a bad module "ManagedPipelineHandler" in its module list
I am unable to figure this out. Can anybody tell me why this happens and how to fix it?
If I don't figure this out, I will go back to first solution (sending GET request from code) but this problem will bug me since I don't even have an idea what's wrong.
Try to re-register ASP.NET with aspnet_regiis -i. It worked for me.
A likely path for .NET 4 (from elevated command prompt):
c:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
http://forums.iis.net/p/1190643/2026401.aspx
If you're running into this error with Windows 8/Windows Server 2012 and .Net 4.5 follow these instructions here:
http://www.britishdeveloper.co.uk/2013/01/handler-extensionlessurlhandler.html
Go to "turn Windows features on or off"
Then Internet Information Services
Then World Wide Web Services
Then Application Development Features
And then enable ASP.NET 4.5
This worked for me (although the wizard and wording is a little different in Windows Server 2012, but you'll figure it out). With this being said, why this is necessary after installing everything through the Web Platform Installer including all of the dependencies is completely beyond me...
Despite following most of the advice on this page, I was still getting problems on Windows Server 2012. Installing .NET Extensibility 4.5 solved it for me:
Add Roles and Features > Server Roles > Web Server (IIS) > Web Server > Application Development > .NET Extensibility 4.5
For Windows 10 / Windows Server 2016 use the following command:
dism /online /enable-feature /featurename:IIS-ASPNET45 /all
The suggested answers with aspnet_regiis doesn't work on Windows 10 (Creators Update and later) or Windows Server 2016:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
Microsoft (R) ASP.NET RegIIS version 4.0.30319.0
Administration utility to install and uninstall ASP.NET on the local machine.
Copyright (C) Microsoft Corporation. All rights reserved.
Start installing ASP.NET (4.0.30319.0).
This option is not supported on this version of the operating system. Administrators should instead install/uninstall ASP.NET 4.5 with IIS8 using the "Turn Windows Features On/Off" dialog, the Server Manager management tool, or the dism.exe command line tool. For more details please see http://go.microsoft.com/fwlink/?LinkID=216771.
Finished installing ASP.NET (4.0.30319.0).
Interestingly, the "Turn Windows Features On/Off" dialog didn't allow me to untick .NET nor ASP.NET 4.6, and only the above DISM command worked. Not sure whether the featurename is correct, but it worked for me.
Run one of these commands :
For 32 Bit Windows OS:
c:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
For 64 Bit Windows OS:
c:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -I
This https://stackoverflow.com/a/13266763/1277458 works perfectly. But if you have 64-bit operation system use Framework64 instead of Framework in path:
c:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i
The problem
You are using SimpleWorkerRequest in a scenario that it wasn't designed for. You are using it inside of IIS. If you look at the prior MSDN link (emphasis is mine):
Provides a simple implementation of the HttpWorkerRequest abstract class that can be used to host ASP.NET applications outside an Internet Information Services (IIS) application. You can employ SimpleWorkerRequest directly or extend it.
Also, if you look at the MSDN documentation for the System.Web.Hosting namespace (SimpleWorkerRequest is in this namespace), you will also see something similar to the above (again, emphasis is mine):
The System.Web.Hosting namespace provides the functionality for hosting ASP.NET applications from managed applications outside Microsoft Internet Information Services (IIS).
The solution
I would recommend removing the call to SimpleWorkerRequest. Instead, you can use a Microsoft solution to make sure your web site automatically starts up after it recycles. What you need is the Microsoft Application Initialization Module for IIS 7.5. It is not complicated to configure, but you need to understand the exact options. This is why I would also recommend the Application Initialization UI for IIS 7.5. The UI is written by an MSDN blogger.
So what exactly does the Microsoft solution do? It does what you are trying to do - IIS sends a "get" request to your website after the application pool is started.
In my case (Windows 10 + IIS 10) i had to open "Turn Windows Features On or Off" and then go to Internet Information Services > World Wide Web Services > Application Development Features > and check ASP.NET 4.6
I solved this problem, adding in "Turn Windows features on or off"
The option ASP.NET 4.7
Making this its own post because this had me going for hours.
I saw maybe a dozen of similar posts here and elsewhere about this problema and the aspnet_regiis fix. They weren't working for me, and aspnet_regiis was acting odd, just listing options etc.
As user ryan-anderson above indicated, you cannot enter .exe
For those less comfy with things outside IIS on the server, here's what you do in simple steps.
Find aspnet_regiis in a folder similar to this path. c:\Windows\Microsoft.NET\Framework\v4.0.30319\
Right-click command prompt in the start menu or wherever and tell it to run as administrator. Using the windows "Run" feature just won't work, or didn't for me.
Go back to the aspnet_regiis executable. Click-drag it right into the command prompt or copy-paste the address into the command prompt.
Remove, if it's there, the .exe at the end. This is key. Add the -i (space minus eye) at the end. Enter.
If you did this correctly, you will see that it starts to install asp.net, and then tells you it succeeded.
Make sure that you have set your application-site version from v2.0 to v4.0 in IIS Manager:
Application Pools > Your Application > Advanced Settings > .NET Framework Version
After that, install your ASP.NET.
For 32-Bit OS (Windows):
C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
For 64-Bit OS (Windows):
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i
Restart your application-site in IIS Manager and enjoy.
I know this is an oldie, but thought I might add some value. For those of us running Server Core outside of a domain (domain members can just run Server Manager remotely to add/remove features/roles), you have to resort to command lines.
Powershell users can type "Install-WindowsFeature Web-Asp-Net45"
That should be equivalent to using server manager.
I was challenged by the same error message, with .net 4.7 installed.
The solution was to follow one earlier mentioned post to go with the "Turn Windows feature on or off", where the ".NET Framework 4.7 Advanced Services" --> "ASP.NET 4.7" already was checked.
Further down the list, there is the "Internet Information Services" and subnote "Application Development Features" --> "ASP.NET 4.7", that also needs to be checked.
When enabling this, allot of other features are enabled... I simply pressed the Ok button, and the issue was resolved.
Screendump of the windows features dialog
Installing .NET 4.7 worked for me. I only had 3.5 installed prior.
I'm working on Windows Server 2012. .NET Extensibility 4.5 feature is on. WebDAVModule removed.
I was still getting 500.21 error on ASP.NET route '/docs'.
Changing 'skipManagedModules' to false fixed the problem.
<applicationInitialization doAppInitAfterRestart="true" skipManagedModules="false">
<add initializationPage="/docs" />
</applicationInitialization>
Thanks to https://groups.google.com/forum/#!topic/bonobo-git-server/GbdMXdDO4tI
I had this problem and found that removing the following folder helped, even with the non-Express edition.Express:
C:\Users\<user>\Documents\IISExpress
This error started happening to me out of nowhere last week, affecting the existing web sites on my machine. I had no luck with it trying any of the suggestions here. Eventually I removed WebDAV from IIS completely (Windows Features -> Internet Information Services -> World Wide Web Services -> Common HTTP Features -> WebDAV Publishing). I did an IIS reset after this for good measure, and my error was finally resolved.
I can only guess that a Windows update started the issue, but I can't be sure.
You could fix it by change the "ExtensionlessUrlHandler-Integrated-4.0" type in iis to System.Web.DefaultHttpHandler
For me, removing WebDAV from my server caused the application to return a 503 Service Unavailable Error message when using PUT or DELETE, so I re-installed it back again. I also tried completely removing .NET Framework 4.5 and reinstalling it and also tried re-registering as suggested but to no avail.
I was able to fix this by disabling WebDAV for the individual application pool, this stopped the 'bad module' error when using PUT or DELETE.
Disable WebDAV for Individual App Pool:
Click the affected application pool
Find WebDAV Authoring Tools in the list
Click to open it
Click Disable WebDAV in the top right.
Ta daaaa!
I still left the remove items in my web.config file.
<system.webServer>
<modules>
<remove name="WebDAVModule"/>
</modules>
<handlers>
<remove name="WebDAV" />
</handlers>
<system.webServer>
This link is where I found the instructions but it's not very clear.
This maybe not a usefull solution for OP but it concerns the same "error" message.
We are hosting PHP pages on IIS8.5 with .NET 4.5 installed correctly.
We make use of the preload functionality to make sure our application is always responsive across the board.
After a while we started getting this error at random.
In the web.config : I put skipManagedModules to true, -> don't do this!
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<applicationInitialization skipManagedModules="false" doAppInitAfterRestart="true">
<add initializationPage="/" />
</applicationInitialization>
...
Although website is php, the routing to the paging is managed by the modules!!!
I also ran into that problem. My MVC4 App is running on a Windows Server 2012 R2 with IIS 8.5. None of these posted solutions worked for me...installing the missing frameworks through IIS Features could have solved it but the installation always failed.
I had to use the Web Platform Installer and installed the following packages:
I was facing this issue in a web application hosted on a shared hosting server. So obviously did not have direct access to IIS, so could not apply many solution proposed here.
On the hosting provider's control panel I enabled error logging for IIS and ASP.Net. And then got to know that error actually lied in a missing cshtml.

Can't view reports on client's machine browser

I definetely stuck here because i've tried almost everything on these posts but no luck yet.
Sepcs:
Server: Windows Server 2008 Foundation Edition (IIS7)
Client Machine OS: Windows XP Pro
Cristal Report ver: 13.0.2
Devolpment: Visual Studio 2010, Web Applications using ASPNET
Problem
I can't view reports on client machine
Background:
I installed crystal reports 13.0.2 on my server and start creating my reports on VS2010 without any problem, even if i compile the web project it works fine, it shows the reports perfectly. As you know when you do that, Visual Studio creates a virtual port to let you try your application.
But when i try to do it from the browser (not using compilation from VS2010) it is not showing reports, i don't see any errors either, even on the server it self, simply doesn't show any report.
Descrption
I have a web application using framework 4 and its under Default Website http://myserver:10000/novo/myapp/default.aspx.
Im using DefaultAppPool in Intregrated mode (also i already tried classic mode)
I copied crystalReportViewer13 directory from wwwroot\aspnet_client\system_web\4_0_30319\, to my web application directory
also, i verified that crystalreportviewers13 directory has been created under windows\Microsoft.NET\Framework\v4.0.30319\ASP.NETClientFiles
After i red SAP Crystal Reports SDK Developers Guide i did this:
on my web.config file i have these tags:
<add key="url" value="http://localhost:10000/novo/myapp/printcontrol.cab" />
<add key="resourceURI" value="~/crystalreportviewers13"
On Desing Mode, under CrystalReportViewer Properties i have PrintMode=ActiveX
And finally i've added my web site on the trusted sites on Internet Explorer and custom all features allowing to install any ActiveX control.
Everything i've done is useless still can't see reports on server or Client Machine browser.
PLEASE HELP ME OUT HERE-----I'M STUCKED, i've spent a lot of time appying some recomendation from this Forum, i don't know what else to do.
What browser? What viewer?
At work, we use both IE (and old version) and FF. With the DHTML viewer, either should work. With other viewers, if the user workstation has improper security settings, then the ActiveX viewer and/or Java Viewer may not work correctly.
In FF, there is a FireBug plug-in that I use a lot. There's a lot that you can see about web page requests, what's loading slowly, what the headers are, etc. (It's a lot more than I can use, and I actually look at it to help hack style sheets or see what sections of a page a holding up loading, more than anything else.)
I've been encountering this problem and searching and almost does the procedure stated above,
i've notice that the aspnet_client is not configure in my IIS and cannot access all files under "crystalreportviewers13".
I solve this problem by registering the aspnet in IIS using using this procedure.
register aspnet:
c:\windows\microsoft.net\framework\v4.0.30319\aspnet_regiis -i
and done!!
my application already accessing files under "crystalreportviewers13"
thanks,
bryan

Visual Studio 2008 Development Server not starting

I have a C# web service that I am trying to debug in Visual Studio 2008, and when I try to run it, Internet Explorer pops-up as expected, but it just displays 'waiting for response from localhost...' in the status bar. I have left it running for a few minutes and it never responds.
I have other web services that I am able to debug fine, is VS2005 and 2008. The problem web service is impersonating a different identity in the web.config file, but I have no problems with this same user on a different web service (in VS2005).
Does anybody have any ideas on what might be preventing it from starting up? Interestingly, a colleague has the same problem with a web service that IS working on my machine, even though we are working with identical code. Something must be configured differently...
By the way, I've noticed that the 'Temporary ASP.NET Files' folder is missing from both
C:\Windows\Microsoft.NET\Framework and C:\Windows\Microsoft.NET\Framework64... I certainly haven't deleted them, and other web services debug okay, so is this just a red herring?
We are also on a domain which has its own firewall (outside of the developers' control) - could this be blocking it?
EDIT: I have just removed the user impersonation for a quick test, and it worked. So there must be something about Visual Studio 2008 that does not want to run when impersonating THIS particular user. Any ideas what configuration I would need to change to correct this?
I have had the same issues with impersonation; I don't know if Cassini (the built-in VS web server) supports this properly. About the best advice I can give is to either use Local IIS with an app pool running as your impersonated user or to attach your debugger using remote debugging to a remote IIS server.
I believe using Local IIS will attach correctly & automatically if configured as much in the Web tab of Project Properties. You'll have to run VS as an admin to get the virtual directories setup automatically by VS in IIS.

Categories

Resources