Yesterday I was writing a stand-alone .html web-page. Every time I viewed it, the file was run in the local host. Thus a port number was assigned by my OS (Windows 8).
The path to my file looked like this:
http://localhost:2038/Projects/test.html
But today, when I run it, the ASP.NET Development Server assigned a different port number:
http://localhost:27290/Projects/test.html
Now my redirects don't work.
This file is pure a stand-alone file. It is not part of a visual studio web-project or anything. So there are no project settings in visual studio to alter. However I do use visual studio as a text editor.
To view the file in the browser I simply right-click over the file in VS2012 and select: 'View in Browser (Google Chrome)'
After I view it in Chrome, Windows 8 pops up a message from the toolbar area informing me that ASP.NET Development Server is running. And it lists the new port too.
How do I change the port to something fixed and not some random value?
Thanks!
I simply right-click over the file in VS2012 and select: 'View in Browser (Google Chrome)'
Doing so in Visual Studio fires up the ASP.net Dev server. It's not Windows that assigns it (nor configures it)
How to specify a port for ASP.net Dev Server no project/solution to speak of, it's just some file on file system....
Update: Unsure if this will be a solution for you:
If you click the "wrench" icon of the dev server in your tray, you will see this:
The executable is in:
c:\Program Files (x86)\Common Files\microsoft shared\DevServer\11.0> (for VS 2012)
If you run it via cmd line, this will pop (instructions):
So if I ran it via cmd line:
webdev.webserver40 /port:8080 /path:"C:\Users\[my user name]\Desktop" /vpath: "/"
the dev server will run on the specified port (8080)
treat my desktop as the "root"
allowing me to type: http://localhost:8080/htmlpage1.html (this file is in my desktop) in any browser...
until I stop the instance running...
Not elegant in any way, so.....
To specify a port for the ASP.NET Development Server:
In Solution Explorer, click the name of the application.
In the Properties pane, click the down-arrow beside Use dynamic ports and select False from the dropdown list. This will enable editing of the Port number property.
In the Properties pane, click the text box beside Port number and type in a port number.
Click outside of the Properties pane. This saves the property settings. Each time you run a file-system Web site within Visual Web Developer, the ASP.NET Development Server will listen on the specified port.
more info: How to: Specify a Port for the ASP.NET Development Server
If you're using VS, you can create a project with just an HTML file (and whatever other non-.NET things you need). From there you can set the port under the project settings. I understand that you're using VS just as the text editor (I do the same thing all of the time), but if you want to set the port, that's how you're going to need to do it because otherwise VS is going to pick a port unless the project file (which is missing) tells it to use a specific port. If you use the "open in browser" feature, it actually launches the web server and uses that to host the HTML file.
An alternative would be to edit/save in Visual Studio and open the file in your browser for testing. This will work because it's an HTML file and you don't need a webserver to view it.
my redirects don't work
The port shouldn't effect your redirects unless you're specifically referencing a protocol and port...but you shouldn't need to do that. Can you post your code or give an explanation as to what's happening here?
Related
I use to be able to connect to my Test Server source code via a Network Drive.
I have mapped it to letter K.
My computer (since last restart) won't run the IDE properly, and always displays the error ASP.NET runtime error: Failed to map the path '/'. at the top of the .aspx file.
I have tried the following:
Starting Visual Studio as administrator
Ensuring that my user has FULL rights to the source code folder (both from the network drive and the server)
Given Network Service and Network users on the server full control over the test server source code folder.
Changing the AppPool identity on the test server to use my username (as I am administrator on the server as well).
Creating a new website project and mapping it on another network drive (Still doesn't resolve the problem).
When I access the test server via my web browser I receive no errors. So I know there is no errors in my code.
If I open the IDE on the server using remote desktop then it works with no errors.
I can live with the error on the top of the page, however when I try to access a DataSet or a Control on the page then it doesn't register the control or function as an existing function.
I am now at a complete loss as to how I am going to fix this.
Any ideas on what could cause this issue and how I could fix it?
I found a work around to the problem by opening the code directly using the IIS on the server.
What I did was click on File -> Open Website, in the open dialog, on the left, I clicked "Local IIS", found my TestServer and clicked open.
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.
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)
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.