ASP.NET development server cannot find localhost ? - asp.net

I have a web site opened in VS 2008 . I try to run it from VS2008 and the asp.net development server starts up.But the browser returns the following error
Firefox can't find the server at www.localhost.
The web address in browser is http://localhost:2921/WebSite2/Default2.aspx

There is no such thing as www.localhost, and nothing built-in to asp.net will redirect you automatically (unless you tell it to). Sounds like you have code that looks at the url and redirects to a www version if you're not there. You shouldn't do that, and instead use relative urls internally that work no matter which way a user hits a page.

Check following :
Are your proxy settings correct in your Firefox browser. Firefox->Tools->Options->Network->Settings.
Are you browsing the correct address, everytime you run/debug your website a dynamic port is assigned unless explicitly specified.

Related

Blank ASP.NET Webpage for the application deployed on IIS

I have an asp.net application deployed on IIS Server located at 10.0.0.74, when
i tried to access it with chrome browser i get an empty or blank webpage.
However if my colleague tries to access it from his computer he get normal webpage with content on it.
It seems really weird to me what might be the problem.
The screen shot below is what the page looks like.
I would appreciate any help
This is not enough to go on, assuming ASP MVC 5 on IIS here are some suggestions.
On your server
Check the following
Is the physical path in IIS correct - actually point to your code?
Do you have any rewrite rules in your web.config that could be redirecting?
Did you set up the bindings correctly?
Are you hitting the site under https / http?
Checked "Turn windows features on/off" and see if ASP.NET 4.8 installed
Did you setup the HTTP Redirection and HTTP Errors
See how you are setting up error handling setup in your global.asax, see here and disable it
Goto your Control panel > Programs and features > Turn Windows features on or off and under "World Wide Web Services" / components:
Common HTTP features:
Default document
Directory browsing
HTTP Errors
HTTP Redirection
Static Content
Security
Basic authentication
Request filtering
URL Authorization
Windows authentication
The problem was that the plugins in "Content" folder were not included in the projects.
I included all the files shown in the image below.
I apologize for wasting your time, i should have checked the console before!

IIS 7.5 doesn't open aspx, html pages

I have two ASP.NET sites on my IIS 7 (Windows Server 2008 R2)
First one works perfect, it opens default.aspx page any other aspx pages as well as html, but second site doesn't open neither .aspx nor .html links, so for example if I try to open http://mysite.com/Default.aspx url, it just shows an empty page without any content or any error.
What it could be?
Thanks.
Well, many things can be broken.
Few tips:
Start Chrome, Firefox (with Firebug addon) or Fiddler or any other http proxy and check what the server is sending - is it HTTP 200, 404, something else?
check IIS logs c:\inetpub\logs\Logfiles\w3svc
check EventLog
compare httpmodules in working website with those of the website which is not working
ensure correct app pool with correct .net version is set for site
try to convert website to webapp
if all fails, delete website and create it from scratch. If it works it may suggest that IIS metabase was damaged.
Another workaround that I suggest:
Open the "hosts" file using Notepad in C:\Windows\System32\Drivers\etc\hosts
then add
127.0.0.1 YourWebsite
Next, try to add binding to a site as suggested here at (http://technet.microsoft.com/en-us/library/cc731692%28v=WS.10%29.aspx)
I hope it helps you.

asp.net setting up subdomain on localhost

I added the following entries in the HOSTS file.
127.0.0.1 abc.localhost.com
127.0.0.1 xyz.localhost.com
Using the VS2010 ASP.NET Development server I am unable to run or execute the website.
When browsing http://localhost:2687/TestProject/ it shows up the default.aspx page. But when accessing http://abc.localhost:2687/TestProject/ it shows a website cannot be found page.
Is there anything else to be done when setting up subdomain on localhost.
EDIT: To make this work I removed the .com and in IE-->Connections-->LAN uncheck everything. Subdomains with port works are correctly getting forwarded. Nothing else need to be configured.
Obvious mistake is that in your hosts file you have abc.localhost.com, whereas you are browsing to http://abc.localhost/folder
Not the same thing.
Not sure this will work as you intend anyhow. I would also recommend IIS Express, part of WebMatrix, which I think is still in beta, or just use IIS. IIS 7+ on Vista, W7, Server 2008 is all really easy to use.
Use IIS or IIS express, rather than Cassini. (For several reasons, which you can google or look for on stackoverflow)
With the IIS you can easily add a hostheader entry to you webapplication with just 2 clicks.
Be aware, that you are assigning both a Url and a port.
So adding abc.localhost won't allow you to browse abc.localhost2687, just the default port (80). If you also want to browse to abc.localhost:2687 you need to a a hostheader entry according to that that Url and port.
This screenshot shows you the dialog to add hostheaders (the picture is from IIS 6, but in IIS 7 or IIS 7.5 it looks very similar)

Website on IIS different than on Apache

I developed a website and published it on a LAN computer running IIS 6.0 all through my testing phase to make sure it looked correct and worked with all browsers. I heavily used CSS for my layout, a small amount of javascript and ASP only for Server Side Includes. The layout was tested in Chrome, Firefox, Opera, IE8 and Safari. All working as intended.
When I went to upload my completed website onto my domains host, the website came out looking completely different as well as the css drop-down menu not working. The following URL shows the differences (sorry both screen caps are combined because of link limit on SO):
Pic
After investigating a little bit, I discovered that hosting site runs Apache as their server. I also ran the ASP command Request.ServerVariables("SERVER_PROTOCOL") on both hosts and discovered that my IIS testing host returned SERVER_PROTOCOL: HTTP/1.1 while the Apache host returns SERVER_PROTOCOL: HTTP/1.0
I am somewhat stuck on where to go from here. Is this difference in server protocols causing my css to be interpreted incorrectly on the Apache server? Can I do anything about it considering my domain hosted server is out of my control? Am I completely off track and should look elsewhere?
CSS is interpreted by the browser, not the web server. The problem probably has to do with the way your hosting provider supports ASP sites (if it supports that at all).
This smells like wrong file references.
Are you sure the live server is not just getting a fatal error and aborting the execution of the page?
Have you checked your error log in your host control panel?
there could be some \ (backslash) instead of / (slash) in some path definition. IIS interprets backslash or slash in the same way (Apache doesn't).

IIS7 automatically redirect to null (in IE)

I'm developing an ASP.NET web site with VB. My web site is work perfectly with Firefox. But, with IE, it's redirect automatically to null.
When I try
http://localhost/mysite/Default.aspx
IE6/IE7 automatically redirect to
http://localhost/mysite/null
But, there is no problem with pages inside sub folders. When I try with
http://localhost/mysite/forum/
It's work perfect. I just can't browse pages in root folder.
What should I do? I'm using IIS7 and .net framework 2.0.
Thanks
Huh... that's strange. "null" isn't really a normal place for web traffic to get redirected. Can you think of anywhere in your code/IIS settings that might redirect to a page called "null" Also strange is the firefox/ie difference.
Does it have something to do with authentication? IE might have automatic Windows authentication causing your application to behave differently because it thinks you are logged in. Try turning off Windows Authentication in IIS.
Alternatively, can you debug your code? Does any code execute on your home page before the redirect occurs?
First uncheck the show error frinedly message in the internet explorer in tools->Internet OPtions->Advance then see.
Another thing if you are redirecting with some dynamic link? And that is casuing it to redirect on null.
Check your code. I think that there may be some problem in your code.

Resources