Visual Studio 2010: Debug web app in root of IIS 7 Web - visual-studio-2010

I'm trying to configure my mvc project, so that I can debug it from IIS7, but I need it to be configured for the root of the web application.
What I've done:
Added the support for the "II6 configuration and metadata support" to IIS7
Created a new site in IIS7 at localhost:5000 (default settings)
Set the property "Use Local Web Server" in the project properties to : http://localhost:5000
When I click save I get the following warning:
"The local IIS URL http://localhost:5000/ specified for Web project MVC has not been configured. To keep these settings you need to configure the virtual directory. Would you like to create the virtual directory now?"
When I click yes I get the message:
"Unable to create the virtual directory. http://localhost:5000/"
The above works fine when I set the url to point to a sub/virutal folder e.g. http://localhost:5000/mvc.
Any ideas?

The solution is when creating your IIS Site, the underlying folder needs to point to the asp.net project folder..
Soo easy if you know the solution :)

In my case, I hadn't added the required host header to the IIS config. After doing so, Visual Studio stopped complaining.
In IIS7 manager, right-click on the site, and select "edit bindings." Make sure that the URL you're entering in VS is listed, and that you can ping it from the command line (should respond from 127.0.0.1). If you can't ping it, add the url to your c:\windows\system32\drivers\etc\hosts file.

Related

The webserver could not be found for IIS-confugured Web Application Project

When I am trying to create a new project in dotnetnuke 9 with for Theme develop using VS, I am getting the following error:
"The Web Application Project is configured to Use IIs. The webserver could Not be found "
I am using VS 2019 and SQL 2017. I create a website in IIS with port 80 that works correctly at localhost. Folder wwwroot/dnndev.me has Network Service permission full access, hostname is dnndev.me without www, there is no .csproj file because the project has not created it yet.
Any suggestions are welcome.
Please check if you have some virtual directories and/or applications in your web site. Visual Studio creates these very often when you open a project. It's safe to remove them - also after opening the project.

How to debug ASP site without port number on VS 2012 Express

I'm trying to debug an ASP.NET 4.0 web site using Visual Studio Express 2012. I've configured the project settings to use the local IIS web server which was installed with VS. I need to use IIS so that urlrewritingnet will work.
I need to run the site locally without a port number. Currently it runs as http://localhost:4652/ which breaks some of the routines since they reference Request.Url.Host. This results in attempts to access resources using http://localhost/.
There is a lot of code to this site and it would be extremely easier and quicker (I think) to just configure my local debug to run on localhost instead of localhost:4652. Is there a way of doing this?
Since it's IIS Express installed with VS there is no configuration manager for IIS. When I click PROJECT -> mysite Properties and change the Project Url (under Use Local IIS Web Server) to http://localhost/ I get a warning that reads:
The local IIS Express URL http://localhost/ specified for Web project mysite has not been configured. To keep these settings you need to configure the virtual directory. Would you like to create the virtual directory now?
When I click on Yes, I get another dialog box saying:
Unable to create the virtual directory http://localhost/
Does anyone know if this should or should not work and if it can work, how do I do it?
You can go to "user/documents/iisexpress/config" then open applicationhost with notepad or other relevant editor then go find "bindings" then change the value of bindingInformation into "*:80:localhost". Done
Its really simple. You need to attach the IIS process to the visual studio and browse the website.
Below article guides to achieve this.
http://www.codeproject.com/Articles/37182/Debug-your-ASP-NET-Application-while-Hosted-on-IIS
Its always a good practice to do a unit test of web apps to local iis while developing.

Manually Assigning WCF Application in IIS

In a Visual Studio "WCF Service Application" project, on the properties->web page, if I select "Use Local IIS Web Server"->"create virtual directory"...it creates the IIS application successfully in the Default Web Site of a local IIS 7.5 install. So far so good.
However, I'd like to use a site other than the default web site. My attempts to host the service in a different web site aren't working. I tried:
Delete the application / virtual directory in IIS that Visual Studio successfully created.
Manually create a new IIS application, in the different web site, using the same settings that were present in the IIS application previously created by Visual Studio automatically.
Go to Visual Studio, project properties->web, and select the "visual studio development server". Save. This is just an "erase" step.
On the same properties page, I select "Use Local IIS Web Server" again and hit save (without pressing "Create Virtual Directory").
In that last step, I expect it to save. It doesn't. It pops up a message saying the virtual directory does not exist. But as I stated, it does exist because I had manually created it just prior.
My own guesses about this problem:
*. The non-default site I've made is somehow different from the default web site, in a way I've yet to determine.
*. Visual Studio is not designed to work with a virtual directory that is not in the default web site.
Any suggestions or clarifications?
I've activated IIS "failed request tracing," but no records are created for this issue.
What you want to do is look at your second site is IIS (the one you want the WCF service to run under) and look at the host name on new or if you go to manage web site -> advanced settings and look at what is after the the bindings. So it may show something like: http:*:80:localhost2 . localhost2 is what you need. It may be an IP Address too, not sure how you set it up.
So then in your WCF project properties in the Use Local IIS Server -> Project URL you put the host name of the site. So for example it may be something like: http://localhost2/yourservice.svc .

Visual Studio 2010 change from localhost to full computer name/domain

I am using Visual Studio 2010 and I would like change debugging environment from the localhost to my full computer name/domain. Does anyone have some step by step instructions on how to do this? (I would also like to set it up as the default for all new projects plus how to change it in existing projects). I am new to using visual studio and programming in general.
I found this post Visual Studio 2010 - Change localhost to custom domain in the forum but it wasn't clear to me on how to make the change. I went to the project properties web tab and attempted to set up local IIS Web server but got the following error:
"ASP.NET 4.0 has not been registered on the Web server. You need to manually configure your Web server for ASP.NET 4.0 in order for your site to run correctly."
I am not ever sure if that was the correct way of going about doing this. I just need my debug url address to go from:
"http://localhost:53674/Projectname.aspx"
to:
"http://computername.pag-domain.webname.org/Projectname.aspx"
Thanks!
For fixing the iis web server, I am not really sure what was done...our IT department worked on that. For setting up the local IIS webserver in visual studio I did the following: In the web project properties, under the web tab, I choose "Use Local IIS Web server, in the project URL, I put the full computer domain and told it to create a virtual directory.
Got it. Our IT came to the rescue — he fixed some issues with the ASP.NET not accessing 4.0 correctly. Then I set up the "Use Local IIS Web server" correctly and it worked like a charm.

What is the Visual Studio's Web Deploy "Mark as an IIS Application on destination" mean?

when I'm trying to deploy to an IIS7 website using Web Deploy, one of the options is to Mark as an IIS Application on destination.
What does this mean when have it ticked on or off?
When setting this option your site becomes an Virtual Application as opposed to a Virtual Directory.
For the differences between the two see: http://blogs.msdn.com/b/wenlong/archive/2006/11/22/virtual-application-vs-virtual-directory.aspx
Here is the relevant text from Oded's reference....
6.If you are not deploying IIS settings, select the Mark as IIS application on destination check box.
This option is not shown if you are deploying IIS settings, because the Web project's IIS application status is one of the IIS settings that is deployed.
You typically select this check box when the Include all IIS settings as configured in IIS Manager check box on the Package/Publish Web tab of the project Properties page is cleared. There are very few scenarios in which you would not want to deploy a Web project as an IIS application on the destination Web server. For example, suppose that the project that you are deploying is not actually a Web application but only contains virtual directory content, such as images, XML files, and so forth. In that case, you might want to clear this check box so that the deployed project is not set up as an IIS application.
It causes the deployed project to be setup as an IIS application on the destination.
If you uncheck it, the project will not be setup as an IIS application.
See step 6 of Creating a Publish Profile on this MSDN article, in particular the last sentence.

Resources