1

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

5
  • Note: not all the config code I pasted is displaying for some reason. If someone could reformat it that would be nice. Commented Sep 14, 2010 at 15:17
  • <membership defaultProvider="WindowsTokenRoleProvider"> <providers> <clear/> <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider"/> </providers> </membership> <profile defaultProvider="AspNetWindowsTokenRoleProvider"> <providers> <clear /> <add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider"/> </providers> </profile> Commented Sep 14, 2010 at 15:18
  • <roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider"> <providers> <clear /> <add applicationName="/" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" /> </providers> </roleManager> Commented Sep 14, 2010 at 15:18
  • Do you get a request to enter credentials when you browse the site from the VM ? Commented Sep 14, 2010 at 15:19
  • Yes, I do get a request for credentials. Commented Sep 14, 2010 at 16:38

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.