Trying to test a ASP.NET website over a LAN - asp.net

I have a XP Pro and Vista machine setup on a workgroup LAN, normal case
with NAT router/adsl modem. Latop is wireless.
The XP Pro laptop has IIS on it and I have written an ASP.NET app.
When I try to access the app from browser on the Vista PC I get an error
saying can't connect to site.
I have tried the following:
Can ping the XP Pro PC from Vista PC.
Turned on Web access from windows firewall.
Rebooted.
When I telnet to it I get http 400 bad request.
Any thing I am not doing please?
Malcolm

Are you debugging your project using the ASP.net development server? I believe that server does not accept external connections.

If you've allowed access through the firewall, I'd suggest looking at your IIS settings for the website. Is anonymous access allowed? What sort of authentication are you requiring if not? Is the website actually running in the url you're requesting?
Lots of different problems occur because of IIS settings. Play with each possible cause, one at a time, until you find out what it is the real cause, if you still can't find it, play with two at a time.
When you finally find the problem, REMEMBER it, because problems with IIS tend to be forgotten and then you have to go through everything AGAIN. Sadly, I know this from experience.

Related

Web application doesn't work with server name and windows authentication but does with IP Address

I have an application that was working on a II 6 development server that uses Windows Authentication. It is a Iron Speed application and I updated a few items and deployed it to the test server where it was previously tested. After deployment, the application doesn't work with Windows Authentication, doesn't even get the credentials login, when I used the full name devweb.etc. It displays a 403 error. However, if I use the IPaddress for it, everything works fine. If take away the windows authentication, the app shows up but of course doesn't work saying it needs a login but it does resolve the web address correctly. I have other applications on the devweb server without window authentication that work without a problem.
Does anyone have any idea of what could cause an application to act in this way?
This ended up being a firewall related issue. More specifically, the firewall switched various websites with the server name devweb to another server which worked fine. Thus, when it appeared like the server was working because devweb sites were working but my particular site on devweb wasn't working except when using the ipaddress. In fact the server was not working correctly and their was a DNS entry problem. Overall, a very frustrating comedy of errors that took too many hours of my life.

Viewing ASP.net Development Server from virtual machine

Microsoft recommends testing older versions of IE with the following virtual machines
This is all fine and good, except that the virtual machines can't see the Dev Server from Visual Studio. This makes it very difficult to develop or debug since I have to copy or deploy to IIS for every little change I make. I've tried using ARR, but it seems it can only forward to one specific port at a time, whereas i need to have the port typed in the address bar of the virtual machine to match the port that it is connecting to on the host machine. Is this possible?
You shouldn't need to deploy to IIS to test changes.
We set our IIS up on development machines to point to the web project folder.
Once IIS is setup, you can add an existing website to your solution, select Local IIS and select the Site from the list of sites (rather than browsing the file system and selecting a .csproj file). You'll now have your site in VS that is hosted by IIS, ready to change and debug, and accessible from remote machines.
Generally speaking you cannot access the ASP.NET Development Server on one machine from another.
Here's some additonal notes on what you cannot do with ASP.NET Development Server from MSDN
ASP.NET Development Server is specifically built to serve, or run, ASP.NET Web pages under the local host scenario (browsing from the same computer as the Web server). In other words, the ASP.NET Development Server will serve pages to browser requests on the local computer. It will not serve pages to another computer. Additionally, it will not serve files that are outside of the application scope. The ASP.NET Development Server provides an efficient way to test pages locally before you publish the pages to a production server running IIS.
The ASP.NET Development Server works only with individual pages and does not include the extra facilities of IIS. For example, the ASP.NET Development Server does not support an SMTP mail server. If your Web application involves sending e-mail messages, you must have access to the IIS SMPT virtual server to test e-mail because the ASP.NET Development Server cannot forward e-mail messages or invoke a server that does.
Anyway.....
Googling around I have found an article where somebody had success on accessing a Development Server remotely using a reverse proxy. I have not tried but here's the link
Configuring a Basic Reverse Proxy in Squid on Windows (Website Accelerator)
Also have a look at this StackOverflow question that has answers describing varous methods to achieve your results
Is There a Way to Make Remote Calls to ASP.NET Development Web Server?
You need to type the development server port into the address bar of the client browser, otherwise host the application in IIS and use the default port.
It is overkill to test with this number of configurations in the development environment. It is generally sufficient to test with 2 or 3 configurations while you are writing code (say IE8, FireFox) - just run these from the local machine (no need for a virtual machine). Once you've finished the UI, deploy your application to a test environment running IIS and test it against the larger range of configurations.
If you test each small change against all of these configurations as the change is made, you'll find yourself overwhelmed with testing. Don't forget that as well as the MS recommended test environments, various configurations of other browsers and operating systems (such as FireFox and Opera, Mac OS) are equally important - you may choose to only test a subset of these configurations depending on your resources.
I too found the link Lorenzo mentions in his comment, but had no luck with Squid configuration.
Happily there's a much easier method, as noted here.
Go to CNET and download SPI Port Forwarder
(Note: Click the "Direct Download Link" below the big green "Download Now" button. If you use the Download Now button CNET tries to install adware on your machine before giving you the file. It's very odd.)
In the first column, "Local Port" put the port you want people to connect to your machine on. I wanted people to come in on 80.
Second column, "Remote host", put "localhost" (it'll apparently port-forward to other machines).
Third column, "Remote port", put the port of the local webserver (in my case the ASP.NET Development Server on port 2485).
Click "Activate"
Hope this helps.
I am answering this old question to help peoples who wants to make it work without IIS. Thank you Fiddler !
1. First Step
You have to download Fiddler.
Once Fiddler is downloaded and installed, open it.
Go in Tools-> Fiddler Option-> Connection tab-> And check "Allow remote computers to connect" :
Restart Fiddler.
2. Second Step
After this, in the VM, open internet explorer-> Internet Options-> Connection Tab-> Lan Settings-> Check "Use a proxy server for your LAN" :
The adress is the IP adress of your DEV machine.
And put the port 8888
Now, you can access the ASP.NET Web Server from your VM !
To access it -> http://localhost.:54814
Don't forget the additional point after "localhost" !
The port, "54814" in my case, is the ASP.NET Web Server port.

Debugging with VS2008 will not work after changing Hostname

I am currently using Visual Studio 2008 on XP Pro SP3.
Developing against http://localhost/ everything including debugging works fine.
I need a second website on my machine. IIS 5.1 only allows one website at a time so I used the JetStat XP Pro IIS Admin tool to create a second website. This runs by stopping the Default website and starting the other.
I have added the new website name into the Hosts file and mapped to 127.0.0.1.
Websites can be accessed via this address http://NewHostname/VirtualDirectoryName
Projects can be started without debugging (Web Applications & Websites).
However, when I try to debug I get an error: "Unable to start debugging on the web server. An authentication error occurred while communicating with the web server."
Integrated Authentication is enabled in IIS.
I have seen a lot of documentation with many fixes for "unable to start debugging on the web server" errors but they all seem like huge overkill for my problem, after all, debugging works fine provided I'm not doing it on this different hostname. They talk about doing things that I would do if debugging did not work at all even with http://localhost/.
Is there a place where I can just add this new hostname so that VS debugging is allowed? Do I need to change permissions somewhere? I feel like there should be a really simple solution that I'm just overlooking.
Here's a description of the problem: http://blogs.msdn.com/webdevtools/archive/2008/08/13/debugging-a-website-with-a-host-header.aspx
And here's the recommended registry workaround: http://support.microsoft.com/kb/896861
Do yourself a favour and download IIS Admin .NET.
This handy little tool allows you to switch between your websites at a snip - each one will become localhost when activated, and crucially, get you out of this debug debacle.
http://www.codeplex.com/iisadmin
You do have to add the hostname to a value within the registry.. but I can't remember where.
Since you can only have one website running at a time, why don't you just have them all running as 'localhost'? This way you don't have to change any annoying registry settings but you still have your applications running in individual IIS Websites.

ASP.NET site deployment on local network

I've created an ASP.NET application and want to deploy it on an XP Pro. machine so it will be available from other computers in the same local network.
What is the right configuration to achieve that?
I've tried to create the application on IIS 7 in Win 7 machine (at home, before going to the customer), but wasn't able to load it from other machine on the network.
Same problem when deploying the site on XP Pro. machine in a virtual machine and trying lo load it from the host machine.
I've canceled an ASP.NET problem by putting a simple html file in the application directory and trying to reach it.
Can you direct me to some check list about deploying a website?
Thank you in advance.
Follow this guide: http://www.wikihow.com/Configure-IIS-for-Windows-XP-Pro
Although I've searched before asking, I've searched again now.
Found this: Can't connect to Default Web Site in IIS 6.0
Disable windows firewall and everything is working....
I fill stupid...
Should this post be moved to serverfault.com? It seems to be a configuration/deployment issue not a programming problem.

Connect remotely to WebDev.WebServer.exe

Developing an ASP.Net website.
Running IE8.
Need to test website under IE6.
MultipleIE6 install broken by IE8 install (can't type in textboxes, yes I deleted cache, yes I re-registered the dll's).
Created VPC running IE6.
Can't connect to host WebDev.WebServer.exe.
Is there any way to configure WebDev.WebServer.exe so that it will accept remote connections?
The workaround for the way that webdev.webserver is crippled to refuse remote requests is to use a lightweight proxy server running on the same host as webdev.webserver. The remote browser then uses the proxy and its requests appear to webdev.webserver like requests originating from localhost. I've used Privoxy succesfully.
Sample config:
Configure Privoxy to listen on an IP
address that is routable from your VM
(eg 192.168.1.1:8118). You can put an IP address on a looback on your host OS and use NAT with the client OS.
Configure your browser(s) in the VM to use
192.168.1.1:8118 for its proxy for all connections including localhost.
Start your app in webdev.webserver
With your VM browser go to the same URL as you would with a browser on your host OS (eg http://localhost:3254)
From the perspective of webdev.webserver the requests will originate from Privoxy on 127.0.0.1 and it will happily serve them up.
UPDATE
These days, I am using Fiddler2 for this. Fiddler has an option in Tools > Options > Connections to "Allow remote computers to connect." But also note that IISExpress can be configured to accept remote connections.
AFAIK, WebDev is coded to specifically reject all external connections... so the short answer would be "no".
Best thing to do would be simply publish the website to your VPC running IIS and test it that way.
I ran into this same issue, and after some research, found that the method detailed at this site worked for me:
http://www.funkymule.com/post/2009/04/17/Making-ASPNET-Development-Server-Listen-for-Remote-Connections.aspx
It involves modifying and reassembling the Webdev server and DLL, but once it's all up and running, I've been able to use older versions of Internet Explorer running in VPC/XP Mode to connect to the WebDev server running on the host machine via the internal network IP (192.168.x.x).
Hmm i am not shure this works, but try adding the WebDev.WebServer.exe to be unblocked from your Windows Firewall.
If this doesn't work you have to install IIS and set a virtual directory directly on your development folder.
I use one of Microsoft's VPC images to test IE6 using the debug webserver, so I don't know what could be causing your issues. Sounds like it could be a networking issue with the virtual machine.
Also IEtester works well for quick checks of rendering and functionality. I have yet to see any major differences between the behavior in IEtester and the real IE6 under XP, but the possibility exists so I still check with the virtual machine before release to production.
http://www.my-debugbar.com/wiki/IETester/HomePage

Resources