Publish Visual Studio 2010 web application to localhost - asp.net

I created a new web application in visual studio 2010.
I tried to publish it to the same computer (localhost) Windows7 64 bit/IIS7
No luck
I read some remarks from others, I also tried to specify the machine name instead of localhost.
I also tried creating a web setup project...
When I "surf" to localhost , I get the IIS7 welcome screen.

you don't need to publish it, just point the virtual directory in iis to your source code.

To host your web application, firstly you need to publish the app to a desired location; after publishing, then open IIS Manager(type "inetmgr" in run and hit enter) and go through sites path from the left panel and then right click on the sites and select "Add website"; In the next step, Add Website form will be opened asking you to enter some details; Enter the sitename, link the physical path to where you previously published and lastly give the port num; If you want to open that website in the port 80 itself, leave it as 80 and then click OK.. You can now browser your published web application... :)

Related

trouble publishing app on IIS, always landing on welcome page

I'm trying to publish a C# app on my windows PC but cant succeed using IIS,
I've been publishing my app with with visual studio no problem,
When i add a new website on IIS and only specify the name and physical path the app is indeed working on localhost,
But when i add my IP to the host name, i can connect, but always land on IIS Welcome Page...
I've tried to move my published folder inside the default website folder but it does'nt seem to work either.
default page for reference

How to configure IIS 7 for localhost website?

I am new in Asp.Net
I have enabled features of IIS 7 on my windows system and able to see IIS manager.
I created an application but build/run application through visual studio it goes to browser and run the application with different port number. When i stop build/run application through visual studio and again i refresh browser application could not run.
I want to run application without visual studio. How to do this.
It gives this : http://localhost:9864/
To configure IIS with a new website follow these instructions:
Open IIS manager, right click Sites (At the right menu) and click Add Website
Give the site a Site Name, The physical path on your machine, and a Host Name
There are some conventions as for what website physical path to choose you can read about it in this SO question
In Windows Explorer go to C:\Windows\System32\drivers\etc and Edit the hosts file
Add this line at the end of the file:
127.0.0.1 your-chosen-host-name-from-iis-ie-localhost.testsite.com
And save the file
Thats about it. You can open your browser and browse the Host Name you chosen for your website or in IIS right click your site and click Manage Website - Browse
Important note
If you wish to use the same address as your VS uses (http://localhost:9864/) then on step 2 leave the Host Name textbox blank and instead change the Port textbox to your desired port (9864). In this case you can also ignore step 3.
As a site note:
If you installed IIS on your machine after the VS installation you might get some conflicts. You might be able by this stage to browse to static content as html but not .NET resources like aspx files. If by browsing to .NET files you get a message saying The page you are requesting cannot be served because of the extension configuration you can solve it with this SO question

Installing .net site locally results in "This page can't be displayed"

I've received some files for a site I'd like to update and am trying to get it running in IIS locally. IIS is working - if I go to http://localhost I get the index.htm file - but if I go to http://localhost/aspxsite/ (their files) I get "This page can't be displayed".
I'm very unfamiliar with this stuff - any suggestions would be appreciated.
I'm running IIS 7.5.7600.16385 on Windows 7 Pro.
1.Open IIS Manager.
In the Connections pane, right-click the Sites node in the tree, and then click Add Web Site.
3.In the Physical path box, type the physical path of the Web site's folder, or click the browse button (...) to navigate the file system to find the folder.
Go to C:\Windows\System32\drivers\etc\hosts.txt and add this line:
127.0.0.1 aspxSiteName
Type in browser http://aspxSiteName

publish a release version of web site

I have a web site that is created in visual studio 2010 through: File > New > Web site (it is not a Web Project).
I want to publish a release version of my web site but there is no 'Release' mode in VS and there is no possibility to add 'Release' mode through Build > Configuration manager.
How can I publish a release version of my web site ??(I can not convert my web site to a Web Project)
Thank you very mush for your reply.
When you have a website project and your using VS 2010 then somewhere amongst the menu options in the menubar across the top should be an option caled COPY WEBSITE (I think its in the website menu).
So you click WEBSITE > COPY WEBSITE then you will see a new tab appear very similar to an FTP kind of interface, with your LOCAL files on the left and the remmote server hosting on the right.
You could use either FTP or Direct upload but the very last time I could only use it via FTP.
(Of course this may be a personal issue and not affect anyone else).
It goes without saying that if you dontr have a server to upload your website to then it can not be "released" as you called it.
Usually the server or hosting is either on your own server or on a remote (Paid for) server with a service provider.
With reference to the photo below....
Area-1 is where you enter the FTP or HTTP address of the server where you will upload te files.
Loacl-Files This shows your completed website files
Remote-Files This shows the files on the server
Controls These button are used to upload or download files to and from the server
Note that you must have an FTP username and password to use FTP/HTTP transfer,
Some hosts may prefer you to use your admin account username and password.
Hope this helps point you in the right direction

Run ASP.NET application as Default Web Site on dev machine

I am trying to run my ASP.NET Web Application Project in my Local IIS Web Server instead of using the Visual Studio Development Server. It seems to only allow me to run my application in a Virtual Directory off of the Default Web Site. However, I would like to run the application in the root of the Default Web Site itself.
I go into the properties of my project, go to the Web tab, click the User Local IIS Web server radio box, and change the Project URL to http://localhost/. However, when I attempt to save, it tells me I need to configure the Virtual Directory, although I am not using a Virtual Directory.
Has anybody made this work before? Thanks!!
It sounds like localhost port 80 is already in use.
IIS creates a default web site that listens on localhost port 80. Have you disabled that before trying to add yours?
Another approach is to have your site listen on a different port, 81 for example.
So far I used a Post-Build event to copy the contents of my project to c:\inetpub\wwwroot\ and I set the Start Action's Start URL to http://localhost/. Not very elegant, but it gets the job done. I would love for somebody to include a more elegant solution.

Resources