Visual Studio tells me that an operational local IIS URL has not been configured - asp.net

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"

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.

Trying to reload project but it says the following error issue IIS web server

The URL 'http:localhost:8081' for Web project 'XXX project name' is configured to use IIS Express as the web server but the URL is currently configured on the local IIS web server. To open this project, you must use IIS Manager to remove the bindings using this URL from the local IIS web server.
It's not allowing me to reload the project..May some thing went wrong while doing IIS set up...

Deploying WCF webservice to IIS

I'm trying to deploy a wcf web service to IIS 7.5. Is there anything special I need to do in order to make this work. I keep getting 404 error when I try and run the web service. I can't seem to pull up the wsdl file either.
These are the steps I've taken
Right-clicked on web service project and published to local folder
Copied contents of publish to IIS server
Setup a new website that points to folder with webservice files
set binding to match web.config binding (port #)
Is there anything I missed or overlooked. Shouldn't I be able to run that web service from IIS and load up the wsdl file directly on the server. When I test in visual studio, it handles the loading of that host program.
Apparently you have to load the .svc file path which I was not doing.
Just to expand on this a little, since this question got me started but there were a couple of extra steps I had to take:
In VS2012 right click on the web service project and select Publish
Publish to file system by selecting a directory to publish to
Copy the folder contents into a folder on the server
In IIS create a new website, its physical path being where you just copied the published contents to.
Set its app pool appropriately (probably .NET 4.0)
The binding port should be the same as in the web.config as should the name. So if you've been working locally and your web.config reads "http://localhost:12345/MyService" then hostname is "localhost" and the port is 12345
You can then browse to the webservice by right clicking on the website in IIS -> Manage Website -> Browse. Click on your service name.

How to hide directory list in ASP.NET 3.5?

I have a ASP.NET 3.5 web site, which is password protected (form authentication). But yesterday I found I was able to browse the list of directories (which is unexpected).
I searched the web, one article said we need to config it in IIS. But I'm a developer and I'm working on my local machine (no IIS installed).
My question is: are there any way to hide them other than IIS configuration? like set web.config?
This must be configured in your webserver - you cannot handle this in the website itself. Since you are working locally it shouldn't matter that the root directory is browsable. If you need to be able to control the site in this way you really ought to set up a webserver.
if you don't have IIS, you're likely working on your local ASP.NET development server (called Cassini possibly?), in which it is only available locally, so no security worries there.
When you deploy your app, you will likely be on an IIS server, so the configuration will be available
Directory browsing in IIS is controlled in the virtual directory/site configuration.
When you deploy your application to a real server you can configure directory browsing there.
Directory browsing on your local machine shouldn't matter, but this may work for you.
In IIS6: http://blog.crowe.co.nz/archive/2006/03/18/603.aspx
In IIS7: http://technet.microsoft.com/en-us/library/cc731109(WS.10).aspx
In IIS - Website properties, Home Directory tab, untick Directory browsing.
In Cassini (the ASP.NET development server) I don't think it can be turned off. But the server only runs while your debugging.

IIS5 or IIS6 Web Application running under IIS7?

I have a web application that runs fine under IIS5 or IIS6. I just installed Vista, which has IIS7. I just copied the entire web app over as-is, no changes to any files. I went into the IIS7 manager and created a web appliction under the Default Web Site and pointed it to the app I copied over.
When I try to browse to the app in IE, it tells me there's nothing there to handle it and that directory browsing is not turned on. This is a .NET app, so it uses Default.aspx. I looked in the manager, and there was no handling of Default.aspx setup. Is that not on by default for IIS7?
So, I added Default.aspx, and now the error is "HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map."
I thought maybe it was because the default for IIS7 is Integrated Mode, so I created a new AppPool for Classic Mode and changed my app to use that. I still get the same error.
I was under the impression that I could move .NET apps to IIS7 without any changes. Is this not true?
0) Check if you have asp.net extensions installed under Programs and Features - Windows Features - WWW services - Application Development Features - .Net Extensibility / ASP.Net
1) The Microsoft .net framework
2) Try copying the whole directory to your IIS's root folder (usually wwwroot), common error that iuser/iwam does not have rights to read the other folder.
3) Check under "Handler Settings" if you have .aspx associated with any Isapimodules.

Resources