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.
Related
I'm have a WebApi project which gets deployed locally on my machine as http://localhost:6143 or http://127.0.0.1:6143.
However when I try to browse to that endpoint on the visual studio emulator for android browser, I get net:err connection timed out.
Note that on the emulator I'm using http://10.0.2.2:6143 since localhost won't work on the emulator (since it's a vm, localhost refers to itself).
I've also tried 127.0.0.1:6143 and get connection refused.
I also added port 6143 to the incoming firewall rules.
Weird thing is that the other emulators installed by xamarin work very well with no configuration issues.
Any clues why this doesn't work? All my searches and approaches have failed so far.
Figured this out after some hunting.
In VS 2015, the applicationhost.config file for asp .net projects is no longer located in the Documents\IISExpress folder. It's now in your project root at .vs\Config.
Once I figured that out, the solution was easy. I went into the config and added a binding as follows (for some reason this was hidden from my original post)
Locate the sites element in the config file for your website/webrole. It's something like:
`<site name="MySite.Service.WebRole" id="3">`
Add a new binding element
<binding protocol="http" bindingInformation="*:6153:myMachineName" />
That's it. Now within the emulator, I can just access http://myMachineName:6153 to access the service.
Conveyor
For this you only need the IP-adress of the Webservice deployed by IIS-Express. To get the IP use the Visual Studio Extension "Conveyor".
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.
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 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
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...