When I try to run IIS Express by debugging an asp.net application in visual studio, I get an error message that the port is being used by another application, regardless of which port I select in the project properties under "Web". Why?
Related
I have two Windows 10 machines. One I can start up a debug session by selecting of typing F5 and the other gives me a message that I cannot connect to IIS Express.
Starting up the debugger on the machine that doesn't work shows:
Starting IIS Express ...
Successfully registered URL "https://localhost:44342/" for site "BSoftSolutions" application "/"
Registration completed for site "BSoftSolutions"
IIS Express is running.
Failed to register URL "http://localhost:51136/" for site "BSoftSolutions" application "/". Error description: The process cannot access the file because it is being used by another process. (0x80070020)
I have been unable to find the differences in these two machines that would cause Visual Studio to fail to connect to IIS?
I install jexus and ran a project diagnostic which gave me this report
IMPORTANT: This report might contain confidential information. Mask such before sharing to others.
-----
Scan the folder C:\Users\RKevi\Source\Repos\BSoftSolution\BSoftSolutions for project files.
1 project(s) are detected.
* BSoftSolutions.csproj
Project file: C:\Users\RKevi\Source\Repos\BSoftSolution\BSoftSolutions\BSoftSolutions.csproj.
IIS Express configuration file: C:\Users\RKevi\source\repos\BSoftSolution\.vs\BSoftSolutions\config\applicationHost.config.
Analyze ASP.NET Core project.
Visual Studio launchSettings.json: C:\Users\RKevi\Source\Repos\BSoftSolution\BSoftSolutions\Properties\launchSettings.json.
Extract debugging profiles.
Found 2 profile(s).
* IIS Express
* BSoftSolutions
Extract IIS settings.
sslPort is 44342.
applicationUrl is http://localhost:51136.
Binding localhost on *:51136 (http).
Binding localhost on *:44342 (https).
A matching binding is found for https://localhost:44342/.
I have a solution with many types of projects, and some of them are websites. Usually, I debug a non-website projects, but everytime I start to debug any project in the solution, the local visual studio IIS starts runnning.
Is there any possible way to stop running the IIS server ???
Thanks!
Open your project and go to the projects Properties. In web apps, you should see a Web tab/choice. Click that, then you can configure which/what server you want to start. I think that the default is that VStudio likes to use it's internal IIS Express, but you can configure it to use IIS locally on the box or to use a custom server.
You can actually set the project to not start anything in the Start Action section on that 'tab' as well, and to simply wait until it registers a connection.
Note that if you are trying to debug using a non-local server, then remote debugging will have to be on on the server, which isn't a great idea in production environments.
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 .
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.
Greetings!
I'm working with a .NET3.5 Web Application project in Visual Studio 2008 on Vista Ultimate. I'd rather use IIS7 than Cassini as my local test web server. I have the website setup in II7 and every thing is served with no problems.
However, I'd like to use the VS debugger hooked up to F5 instead of manually attaching to the process. So in my HOSTS file, I have:
127.0.0.1 mysite.com
In my website project's "Web" settings, I have:
"Use Local IIS Web server" is selected
Project Url is "http://mysite.com"
Override application root URL is "http://mysite.com"
Also, in IIS, I've bound mysite.com to 127.0.0.1 on port 80. In addition, the account used to run the IIS server is a member of the Administrators group and I run VS2008 as Administrator.
However, starting my project with debugging yields this error:
Unable to start debugging on the web server. The IIS worker process for the launched URL is not currently running.
Any ideas why I can't get VS debugging to work with IIS?
Problem solved. Instead of binding to 127.0.0.1, I changed it to "All Unassigned" and I'm back in business :)
We fixed it by replacing "::1
localhost" by "127.0.0.1 localhost" in
the hosts file.
Found this in the ASP.Net Forums:
http://forums.asp.net/t/1394972.aspx
Not sure it will help but worth a try...