I am using VS2013, IIS7, and have set a subdomain in IIS and my hosts file to point to 127.0.0.1.
I've created the secondary website, and have the http binding in IIS pointing to localhost.subdomain.com.
Things i've tried:
IISReset
Deleting Site in IIS, Deleting app pools, re-building from scratch
Cleaning/Re-building solution/Restarting Computer/Visual Studio
Creating Virtual Directory through VS, even tried tying to IISExpress to no avail.
Also, i can go directly to the site in a browser just fine using the http://localhost.subdomain.com and traverse through it all, it just fails to load into Visual Studio for debugging. All debug info is set correctly through project properties as well.
There are a bunch of people within my office with the exact same setups that i've sat down with that work fine on their machines, but not on mine. I've exhausted my google and microsoft.com searches at this point, any suggestion would help.
Visual Studio is unable to resolve the domain because it likely hasn't been added to your hosts file.
If you edit the hosts file found at C:\Windows\System32\Drivers\etc\hosts to include your subdomain:
# rest of hosts file here
127.0.0.1 api.localhost
Then your debugger should start working again.
Related
I am trying to set up an ASP.NET Core test website on my Windows 10 machine. I followed the steps found in the ASP.NET Core documentation (https://docs.asp.net/en/latest/publishing/iis.html), but when I browse to the site, I get a 403.14 Forbidden error. I can Run the app through Visual Studio, fine and everything is rendered as expected, but when I Publish the site, the error appears. A few other items:
The root of the site is pointing to the wwwroot folder of the published output as it should be.
I can place a static file in the wwwroot folder and access it through the browser fine. Problem only seems to happen when browsing to MVC code. When enabled, directory browsing works fine as well.
Routing, controllers, and views are set up correctly. I can Run and Debug the site in VS fine with an instance of Kestrel running.
I am trying to access the site via port 80 on a test URL specified in my hosts file (I am hosting a number of other sites fine on the same machine already with this common config).
The app pool is configured correctly using No Managed Code.
The IIS instance has full file permissions to the folder.
I am thinking I have something messed up in my installation (I had a previous install of HttpPlatformHandler installed previous to the RC2 where it was replaced by AspNetCoreModule). Any thoughts?
I created a Windows Server 2008 virtual box with IIS7. I have two websites configured, one is my actual development site and the second is a test site to help troubleshoot this issue.
Website 1 (WS1) - the root of this website is on a drive which is mapped to my development machine (Mac Book Pro). The mapping seems to be working and I can access all files fine (W:\www\dev.frogquest.com).
Website 2 (WS2) - is a very simple website with one ColdFusion page just to prove that everything works. It's root is a local directory on the C:\ drive of the VB (C:\sites\localtestsite.com).
I've added host file entries for both sites (127.0.0.1 ...)
WS1 - Throws a Server error when I try to access it...
HTTP Error 500.19 - Internal Server error
The requested page cannot be accessed because the related configuration data for the page is invalid
Here's what I've tried so far...
Uninstalled both .NET 4.5 and URL Rewrite 2, rebooted, reinstalled .NET 4.5, rebooted, reinstalled URL Rewrite 2 Module… retried… FAIL! I took these actions because of information I found here...
HTTP Error 500.19 on IIS7 "Malformed XML" in web.config
Per the same article as above, I tried deleting the web.config file. Strangely, this had no impact, even after restarting the website, restarting the virtual box instance, etc... which I've done frequently btw just to rule that out.
I tried adding IIS_IUSRS to the WS1 directory, but because it's a mapped drive I didn't get a "Security" tab. So, this was fruitless. This was per this article...
IIS 7.0 Error - 500.19 Internal Server Error
I tried playing with the AppPool security, changing it from "pass-through authentication" to connecting as the administrator of the machine. When I clicked "Test Settings" I did get different results, but they didn't have any material affect in the actual server response. I have screenshots of the test setting results.
I copied the contents of WS1 into WS2 and this works! So, it has something to do with the fact that it's a mapped drive and very likely a permissioning issue in my opinion.
I am now out of ideas and in need of competent help and fresh ways of thinking about this!
UPDATE: Adding a screenshot of the actual error for more info...
IIS does not support any type of mapped drive,
https://support.microsoft.com/en-us/kb/257174
You will have to use the recommended workarounds, such as UNC paths.
So I'm trying to setup a local test domain so I can have a subdomain using this article. My problem is that I can set up the sites fine in IIS and browse to files there. But when trying to setup visual studio to use the site for eg. In Project Url: http://localtest.me when I click Create VirtualDriectory I get the following error: Unable to create virtual directory. The URL 'http://localtest.me' is already mapped to a different folder 'C:\Websites\site'.
If I delete the site from IIS and allow visual studio to try create it, I get the following error: Unable to create the virtual directory. Could not find the server 'http://localtest.me' on the local machine. Creating a virtual directory is only supported on the local IIS server. But the site localtest.me poits to 127.0.0.1, which is my local machine right?
So how do I set up debugging in a scenario like this where I already created the site in IIS?
Instead of using the "Use Local IIS Web Server" setting in visual studio I always check "Use Custom Web Server" and point it at my local url. for your example localtest.me with the start url above set to localtest.me
If you still run into problems you can always get into debug mode but doing attach to process instead of F5 and selecting the IIS process.
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.
My setup:
Vista 64-bit PC (my local PC)
IIS 7 obviously
VS 2008
I setup a new "Application" manually under the IIS default site. It's running.
The application is pointing to the correct directory (where my default.aspx exists)
I've setup this same exact setup on our dev server running Server 2008 and it runs fine
But for me, when I go to http://localhost/MyAppName I get a 404 not found.
I have no clue why.
So since that did not work and still got a 404, then I tried instead changing from using the VS web server to using IIS in my web project properties in the "Web" tab in VS 2008. Then clicked the "Create Virtual Directory" button and it created a new Application in IIS for me. Same thing though. If I go to that address, I get a 404 on my local machine where it's running.
Ok, I had not installed the IIS 6 functionality of IIS in Vista. I did not know it still used legacy features in IIS 7 to run sites locally....I guess. Not sure why but I guess it uses these IIS6 features. Will have to research why it's dependent on this stuff.
Do you have the home directory to look for "default.aspx" as the default page?
A couple things to check:
First, look at your access logs to see exactly what request is getting logged.
Check your IIS config - you may have a default.aspx page, but is IIS configured to use that as one of the default pages? If you go to http://localhost/AppName/default.aspx do you still get a 404?
If you put a static test.html file in the same directory, can you access it?
These should all help determine the cause.