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/.
Related
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?
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.
Tried both Visual Studio 2015 and 2017 with the latest updates, different web apps (.NET Framework and .NET Core based). IISExpress is 10.0, Windows 10 Pro.
When I run a web app like http://localhost:49217, it works. If it's http://mydomain:49217, I get "mydomain refused to connect". At the same time, if I do "ping mydomain", it's successful.
I did:
"mydomain 127.0.0.1:" in hosts file
<binding protocol="http" bindingInformation="*:49217:mydomain" /> in applicationhost.config (both replacing localhost entry and keeping both localhost and mydomain)
made sure that this is the actual applicationhost.config (as there are many locations of them in different Visual Studio versions). For instance, when I change settings directly in Visual Studio, I see that this file gets updated.
"netsh http add urlacl url=http://mydomain:49217/ user=everyone" under Admin privileges
I tried to run Visual Studio as Admin and also running IISExpress directly (also as Admin):
C:\WINDOWS\system32>"c:\Program Files\IIS Express\iisexpress.exe" /config:"c:\solution_path\.vs\config\applicationhost.config" /site:"solution"
Starting IIS Express ...
Successfully registered URL "http://localhost:49217/" for site "solution" application "/"
Successfully registered URL "http://mydomain:49217/" for site "solution" application "/"
Successfully registered URL "http://*:49216/" for site "solution" application "/"
Registration completed for site "solution"
I then see incoming connections when it's localhost but not mydomain.
I tried to turn off Windows Defender Firewall for Private and Public networks, to no avail.
What else can I do?
EDIT:
I now tried to run one of web apps (.NET Core one) under Kestrel and this worked from the start, I can access http://mydomain:49217 just fine. It's only IISExpress which isn't working, and I have to to use IISExpress, Kestrel is not an option for me.
You could install our free VS extension called Conveyor (in Tools->Extensions). It will open a new port that will accept connections from other host names.
Eg. it will open port 45455, then you can go to http://mydomain:45455
You won't need the binding changes anymore, but you will need to keep the hosts file change of course. Also you can signup for tunneling if you want to use one of our subdomains to access over the internet.
I have a visual studio solution and when I opened it I got an error saying:
"http://localhost:55365 : error : Unable to open the Web site
'http://localhost/_1'. To access local IIS Web sites, you must install
the following IIS components:
In addition, you must run Visual Studio in the context of an
administrator account.
For more information, press F1."
What is strange is that nothing is listed to install. NOTE : I have run visual studio as administrator. This is a screenshot of the solution in the explorer...
Really I have 2 questions:
1) What is the project type of the second project in the solution explorer?
2) Why wont it load? I do have IIS installed and I have other sites that run under the web development server....
Web Application or Web Site.
Project was pointing to a local IIS web site but this doesn't exist anymore.
About 2), maybe you erased by error your web site code and its physical folder, or the IIS web site.
I have my development PC on Windows 7 for ASP.NET and running Visual Studio 2010 and IIS 7 (NOT using the development web server). I have created multiple websites on different ports on my PC. E.g. http://localhost:8080 points to Website A. But when I open the site in Visual Studio, the project name shows as http://localhost:8080, as follows.
I would like to change that name to http://WebsiteA or http://WebsiteA:8080. Some identification.
I edited hosts and added
127.0.0.1 WebsiteA
Ping works fine. Also browsing WebsiteA:8080 works fine. But when I try opening the site (http://websitea:8080) in Visual Studio, it says Web site does not have Frontpage server extensions installed.
Is there any way to at least rename what's shown in the project list in Visual studio. I just need an identification on each website. I have about a dozen project and more may be added.
Thanks
IIS in Windows 7 allows you to have named virtual hosts. You can use that to separate out your sites. Visual studio cooperates with the naming of the virtual hosts. You will need to configure your visual studio project to operate against IIS (for debugging and running) rather than the visual studio built in web server.
Managed to find a way. This is what I did. Went to IIS Management, Created a new Website - Give it a name WebsiteA, Choose the folder where the web is located and give it a Host Name - WebsiteA. Click OK
Then go to Application Pools. You'll see your Host name there. Change the ASP.Net version to 4.0 or whatever you want. Then add a hosts entry 127.0.0.1 WebsiteA.
Now you can add http://WebsiteA in Visual Studio.
Thanks for all the help guys