How to configure IIS first time for any web app? - asp.net

I have a website made in ASP.NET .Currently is being opened directly with Visual Studio.
Now i want this to be opened with localhost with IIS features enabled.
I need steps to make this website totally IIS enabled

1- You have to Publish your website with Visual Studio
2- Create a Virtual Directory (or Web Application ) on Your IIS
3- Map Your published website to IIS Alias
4- Change your web.config settings if it is necesary
5- Check if you need to add some new HttpModule to your application
6- Browse your website with http://Localhost/YourIISApplicationName

Check these tutorials How to setup an ASP.NET website with IIS &
How to host an ASP.NET application in IIS the latter one uses IIS 7 (I guess)

Related

How can I get Visual Studio to automatically attach debugger to web Site not Application?

I have a web application required to run as a Web Site (root application). This is due to it being a multi tenant application that uses the urls sub domain prefix to know which client is accessing it. I create the site in IIS 10 setting the physical path to my Visual Studio 2017 .NET 4.5 MVC application and the site works fine.
I open the web project properties and under Servers choose Local IIS setting and set Project Url to the site I just created in IIS. Visual Studio then forces me to create a Virtual Directory for the Project Url, to save it, which then creates a Web Application under the default web site. You can't set and save the Project Url without being forced to create the virtual directory.
Now when I start debugging Visual Studio attaches to the Web Application not my web site so my breakpoints never get hit. If I manually attach to the w3wp process where the web site is running I can debug. I had this all working fine prior to recently switching to Git causing me to reconfigure things and I can't recall what I did to make it work.
How can I set the Project Url on web properties page without being forced to create a virtual directory? Or how do I make VS automatically attach to the Web Site and not Web App I was forced to create?
This blog might help: How to Debug Your ASP.NET Projects Running Under IIS
If your project is a website and not a web app, then here are the steps to configure it to use IIS when debugging. This assumes you already have IIS set up and hosting your project.
In the solution explorer.
Right-click on your project node and navigate to "Property Pages".
Navigate to "Start Options" item in the left pane.
In the "Server" section make sure "Use custom server" is checked.
In the "Base URL:" field put in the address you have mapped to your project. (Usually the address you put in your hosts file)
I finally discovered that setting the Servers 'Project Url' in the web projects properties page to 'http://localhost/' does not force you to use the 'Create Virtual Directory' to save the changes. You can't even change the default port here without being forced to create a virtual directory.

IIS Express website works fine, not in IIS

I have an application that uses IIS 7.5X and Visual Studio 2013 and it works fine in IIS Express. I have had to make changes to allow authentication and allow 32-bit but it still doesn't work on IIS, only IIS express.
I have tried to use the publish in VS2013, but that doesn't seem to work.
Is there anyway I can find the settings used by IIS express so I can set IIS up so it works the same?
Where do I setup logs? Thanks in advance for not closing this question!
Also, when I run as IISExpress I see the images and styles that don't appear when run as an IIS site.
Where can I find out the settings used by IIS Express?
Pete
For me, I had to set Identity of my application in Advanced Settings of Application Pools in the IIS to Custom account and then set an admin local account to it.
Don't forget to Restart your site from the IIS after doing it
In IIS Express can you make "Deploy -> Export" and than in regular IIS to do "Deploy -> Import" ?
2.
Major settings of IIS stored in files that located in folder C:\Windows\System32\inetsrv\config\

Why is my web site working in VS 2013 but not in IIS 7.5?

I have a web site project, that when I debug under the 'default web server' inside VS, it seems to work fine. When I try and debug under IIS or run the site straight from IIS, I get served up a blank page. No error message or log, whether I make Login.apsx or 'Default.aspx' my site's default document.
The site is build against .NET 4, and is configured in a .NET 4 Integrated Pipeline app pool. I tried Classic as well with no difference.
Which is first page of your web application ? have you put it as default document ?
Try with following web address and check it browse
"http://ipaddressofserver/websitename/page.aspx"
Follow the steps:
1) Be sure you have enabled the asp.net in IIS from windows feature.
2) Make sure IIS works by opening address http://localhost:80
3) Share your website folder with everyone with read access.
4) Add your website in IIS with port number other than 80.
5) Keep the application pool in version 4.0 Integrated.
6) now browse the website.

aspx pages downloads after hosting in IIS?

We hosted the website in IIS. When we test the home page of our site IIS suddenly offering to download the aspx page instead of rendering .
We hosted the website in IIS 7.0. Website developed with DotnetFramework 4.0.
Please help me in identify the bottom of the problem.
You'll need to drop into the command prompt and navigate to the folder;
c:\windows\microsoft.NET\Framework\V4.0.30319\
and type the command aspnet_regiis -i
this will configure the IIS server to correctly process the aspx files - not sure why it would work previously and then suddenly stop working, have you used this explicit version of .NET on this server before?
You have to configure it once again. Before that, follow some steps mentioned below:
You have to build the web application within your Visual Studio.
After successful build,you have to publish the application and save that published copy to specific folder say 'MyPublieshedApp'.
Start IIS and add new website. You have to point the folder which contains the published content of your application. In this case the folder should be 'MyPublishedApp'.
Set the application pool and set the framework version to ASP.NET 4.0.
5.Then browse one of the page after configuring it into the IIS.
May be this will help you.

Visual Studio tells me that an operational local IIS URL has not been configured

I am trying to get a web application project working, after we moved from a StarTeam repository to a TFS repository. I have a web site on my local IIS for the project; this web site is up and serving static content when I test it, but when I copy and past the URL to that site into the Local IIS Web server's Project Url in VS 2010, I get a message that the local IIS URL has not been configured. The popup that displays this message offers me the chance to create a new virtual directory, but this fails. Anyway, this is not what I wish to do.
I usually find myself setting things up in IIS and then copying the URL into VS, but I ensure:
IIS has IIS6 management compatibility components installed.
The folder in IIS is the root of a web application.
The app pool for the web app is configured with the correct .NET version.
And to add to Richard's answer:
Ensure the site's binding in IIS is set to "All Unassigned"

Resources