Search code examples
visual-studio-2010asp.net-mvc-2iis-7windows-authenticationremote-debugging

Using IIS7 and vs2010 to do remote debugging with MVC2 and Windows Authentication


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" />


Solution

  • I started over and everything has been working fine. I'm curious what the problem is, but with all the settings I was messing with (was doing a lot of experimenting as this was my first MVC project) I probably hosed something.

    I don't think I have enough information to really solve the problem, so I will close this question.