I have an ASP.NET project which developed in visual studio 2010 on my computer.
I can open its pages using address like : localhost:52413/Default.aspx .
I want to reach that page from my smartphone which is connected in same wireless network. How can i do that. First of all i tried 192.168.2.2:52413/default.aspx
What should i do?
If you are using the Visual Studio built-in development server, then you are not going to be able to open the website on another computer (or smartphone). This web server is bound to localhost. But you have three options to test your website on your smartphone:
Use IIS Express
Install IIS Express
Change project settings to use IIS Express instead of the built-in web server
Configure IIS Express to listen to remote requests.
Use IIS
Install IIS
Change project settings to use IIS (instructions for Visual Studio 2008, mostly the same in Visual Studio 2010)
Transfer your files to a web host where you have a domain name and hosting contract
For 1. and 2. you probably also need to configure your local machine's firewall to allow incoming traffic.
This can be done quite easily using Fiddler.
www.fiddler2.com
First download and install Fiddler.
Start the program and select "Tools" -> "Fiddler Options" from the menu.
In the options dialog select the "Connections" tab and check "Allow remote computers to connect".
A 'restart required' dialog may appear.
Now select "Rules" -> "Customize Rules" from the menu.
This opens a text file called "CustomRules". At the end of the "OnBeforeRequest" method (around line 188 or so) add the following:
if (oSession.host.toLowerCase() == "192.168.2.2:8888")
oSession.host = "localhost:2000";
Save the file. Close it. Restart Fiddler.
Start your web application (I usually configure the web site with a static port) like normal and verify that it's viewable on the computer through localhost:2000 (or whatever port number you have decided to use. It must match what you entered in "CustomRules", though).
Now you should be able to browse the web application from any device on your lan provided firewall and such let you by pointing a browser to http://192.168.2.2:8888
Maybe the firewall on your computer is blocking connections to port 52413. Try turning off the Windows Firewall to see if that helps.
local development server can be use only from local machine, publish to your app to or you can install UtilDev Web server (former Cassini)
Related
I have just made an ASP.NET web application with VS2015 (framework .NET4.6.1). The project is on my computer but I want to make it accessible from other computers in my office (I think we have a local area network). I have IIS installed. How can I do it?
The most solid (but also more complicated way) is to install a server somewhere in the office which can only be accessed from inside. That said, these are the steps I used to do this a while ago, though I can't guarantee they'll work flawlessly (or at all anymore).
Configure IIS Express (VS2015) to accept outside network connections (on the same subnet)
Find out your local IP address, computer user name, and the project port number.
Go to PROJECT_FOLDER.vs\config\ and open applicationhost.config in any plain text file editor (recommended: Atom or VS2015)
In the applicationhost.config, find the sites section in system.applicationHost. In there, you will find a section . Under , add a new binding with . Save, and close.
Open an elevated windows command prompt or Powershell (recommended).
Execute the following commands: "netsh http add urlacl url=http://IP_ADDRESS:SITE_PORT/ user=USERNAME", "netsh advfirewall firewall add rule name="IISExpressWeb" dir=in protocol=tcp localport=SITE_PORT profile=private remoteip=localsubnet action=allow"
Done
When you're finished testing, you should disable the connection settings again.
Remove the bindings in the application.config file you just added.
Run the command "http delete urlacl url=http://IP_ADDRESS:SITE_PORT/"
Delete the firewall rule with "Delete rule name="IISExpressWeb"" in an elevated command prompt.
Use your IP address for deploying in your work network.
Use this link (Step-by-Step with pictures) for publishing in your local network.
(Supports VS2015)
Link 2 : Better Deployment with Support from VS 2010 to VS 2015
I've been trying to fix this for quite some time now, but I simply can't make any ASP.NET projects in Visual Studio Express 2012 for Web. I get this error when I start a new project:
Web application projects are currently configured to use IIS Express. To switch back to using the Visual Studio Development Server, change the development server option under the Projects and Solutions/Web Projects Category of the Options menu. Configured IIS Express failed with the following error:
Filename: redirect.config
Error: Cannot read Configuration file.
So I went on the internet to try and find others with the same error but I can't find a concrete solution to my problem. I find something similar for older versions, but it doesn't fix my problem. I do have the IIS Manager up under my Services (When you want to Manage Windows). I even made a virtual folder, but to no avail. Still doesn't work.
I want to use IIS
How do I fix this?
In Solution Explorer, right-click the name of the Web application project for which you want to specify a Web server, and then click Properties
In the Properties window, click the Web tab.
To choose the Visual Studio Development Server, under Servers, click Use Visual Studio Development Server.
To use a specific port number with the Visual Studio Development Server, select Specific port and enter the port number. By default, the Auto-assign Port option is selected, and the port number that has been assigned to your application appears
To choose IIS, under Servers, select Local IIS Web server. This option is not available if IIS is not enabled on your computer. A URL that combines localhost with the name of your Web application will automatically be created for you and appear in the Project URL box (for example, l ocalhost/WebApplication1).
To choose IIS, under Servers, select Local IIS Web server. This option is not available if IIS is not enabled on your computer. A URL that combines localhost with the name of your Web application will automatically be created for you and appear in the Project URL box (for example, loca lhost/WebApplication1).
To choose a custom Web server, select Use Custom Web Server. In the Server URL box, type the URL that Visual Studio should start when it runs the current project.
You may for example open you project file in notepad search for the string <useiisexpress>true</useiisexpress> replace it with the string <UseIIS>True</UseIIS> save and reload the project.
Make a copy of the project file first though.
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.
Recently I installed Oracle and the required Microsoft Loopback Adaptor, which worked fine. However, this seems to have screwed up IIS (or at least its interaction with Visual Studio) somehow. I can't connect to localhost or 127.0.0.1 anymore, and I can't even open a web project in Visual Studio 2008 (which used to work fine), getting the error "The local IIS URL http://localhost/MyProject specified for the Web project MyProject has not been configured. In order to open this project the virtual directory needs to be configured. Would you like to create this directory now?" I click yes, then it gives an error that it "could not find the server http://localhost on the current machine".
IIS is running and I can connect to the default IIS website and other contents of inetput/wwwroot on localhost:1122.
I tried to disable the loopback adaptor and comment out the line I needed to add to hosts to get Oracle working, and while this has stopped Oracle from working, it hasn't helped with IIS/localhost.
edit: this turned out to be fixed by restoring the project from a backup, so it must have been an issue with the project itself of some sort.
I am guessing it's a problem with the loopback adaptor. You might have to restore your Connection settings properly. Check whether the loopback adaptor is properly disabled and whether Connection settings are correct from Control Panel->Network Connections.
Edit:
Also it would be better to restart the system after you have made all the necessary changes in the settings.
You could configure your local IIS to listen on a different port. Right click Default website, tab Web site, then Advanced. Add for example 1234 as a TCP port.
Then you can connect like http://localhost:1234/YourProject
You can open the website in Visual Studio from the file system, and specify the new URL in Project -> Property Pages -> Start Options -> Use custom server.
Ok, I finally managed to get this working by deleting the project and restoring from a backup. I guess the project configuration had somehow become screwed up in such a way as to cause the error I got, rather than there being a problem with IIS itself. Sorry for the false alarm.
Something similar happened to me today on Windows XP and IIS 5.whatever-it-is. The problem is that a tool I installed had created some Virtual Directories without an Application Name under the Default Web Site.
The solution was to open up the IIS snap-in, right-click and choose Properties for the offending virtual directories, and make up an "Application name" under the "Virtual Directory" tab of the Properties dialog that pops up. It didn't matter what I named it, as long as there was no virtual directory under the Default Web Site with a blank application name.
I have installed Visual Studio .NET 2005. But when I am trying to execute an asp.net application then I am getting the following error:
Unable to open the Web 'http://localhost/adiii'. Could not find a Web server at 'localhost' on port 80. Please check to make sure that the Web server name is valid and your proxy settings are set correctly. If you are sure that everything is correct, the Web server may be temporarily out of service.
Click here to view screenshot of the error I am getting
Can anyone please tell me the solution of this problem. As we know there is embedded Web deployment server inside VS2005 then why its giving me this error??
It looks like when you created the project, you selected HTTP for the location instead of the default, File System. HTTP means you have an existing web server (not Visual Studio) that you want to run and test your project on (and where Visual Studio will attempt to find your source code).
Create a project and select File System to create a project on your harddrive that will be run using Visual Studio's internal web server (you can then publish/deploy the project to a real web server when you want)
Are you explicitly have defined that the internal web server should run the application on port 80?
The default behavior is that it runs on a random port.
If your settings are ok, then it might be a port conflict with another web server on your machine (Apache, IIS).
Sometimes even a Skype can okuppy port 80 and cause similar problems.
Update:
Now i see - you're using Web Site project, and we assumed you're working with Web App project instead.
In this case, the procedure is slightly different:
You select the project in Solution Explorer and open Property Pane. Here you should be able to identify two properties for the project: Port number and Use dynamic ports. I assume your first property is set to 80, and second one to false. Change the second one to true and you should be able to fix the problem.
There's a very good chance that you created the project in VS2003 and upgraded it to VS2005. VS2003 uses HTTP (a local installation of IIS for example), whereas VS2005 projects use the built-in server -- most likely, the upgraded project is still trying to use the local IIS which doesn't exist.
Do this: Right click on your project, choose "properties", and navigate to the "Web" tab on the window which pops up. You'll get a screen which allows you to choose which server you want to develop on, then make sure the buttons next to "Use Visual Studio Development Server" and "Auto-assign port" are checked.
Here's a visual reference if you need one:
http://img24.imageshack.us/my.php?image=confignw0.png
You should be be good to go now.
Visual Studio does have an embedded web server, but it never operates on port 80. Your URL clearly points to port 80.
The most likely problem is your program itself working inappropriately, but without code I can't help much more.