What I am doing
I am building an MVC2 website with Windows Authentication using Visual Studio 2010. I want to debug the website using IIS7 and access it from a browser in a virtual machine (in order to sign in using different users with different privileges).
Problem
When I try to access my website from my virtual machine, I get the following error:
403 - Forbidden: Access is denied. You do not have permission to view this directory or page using the credentials that you supplied.
Environment
I have visual Studio 2010 set to debug using IIS and to "Don't open a page. Wait for a request from an external application." I have created www.myWebsite.com in IIS7 on my host machine and have only Windows Authentication enabled.
I have made appropriate entries in the hosts file on both the virtual machine and my host machine so that when I type www.mywebsite.com into the browser on my virtual machine, it targets my website I set up on IIS7.
I tested my IIS7 setup process by using the same settings to set up an html website (with the same web.config security settings) and I could access that from my virtual machine. For this reason I think the problem has something to do with my application. IIS7 is set up to use .net 4.0 and Integrated Pipeline Mode.
Code
Here is my web.config file:
connectionString="metadata=res:///Models.ReportDB.csdl|res:///Models.ReportDB.ssdl|
res://*/Models.ReportDB.msl;provider=System.Data.SqlClient;provider connection string="Data Source=JDOE-
PC;Initial Catalog=ADVENTUREWORKSDB;Integrated Security=True;MultipleActiveResultSets=True""
providerName="System.Data.EntityClient" />
res:///Models.WDB.ssdl|res:///Models.WDB.msl;provider=System.Data.SqlClient;provider connection
string="Data Source=JDOE-PC;Initial Catalog=WarehouseDB;Integrated
Security=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" />
PublicKeyToken=31BF3856AD364E35" />
PublicKeyToken=31BF3856AD364E35" />
PublicKeyToken=31BF3856AD364E35" />
PublicKeyToken=b77a5c561934e089" />
type="System.Web.Security.WindowsTokenRoleProvider"/>
type="System.Web.Security.WindowsTokenRoleProvider"/>
type="System.Web.Security.WindowsTokenRoleProvider" />