I have a .NET web application in which I am developing three separate websites that all share some classes, master pages, etc. (Call the sites mysite1
, mysite2
, and mysite3
)
When I view the site using "View in Browser" from VS (which leads to http://localhost/projectName/mysite1/default.aspx), everything works as expected.
However, I also setup an IIS website called Mysite1
that uses http://mysite1/ and points to the "mysite1" subfolder as its local path (under Home Directory). When I visit http://mysite1/, I get the following ASP.NET error:
Parser Error Message: Could not load type 'MyProject.Mysite1.Default'.
Source Error:
Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MyProject.Mysite1.Default" %>
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
The namespaces are all valid, as evidenced by the site working correctly when run from "View in Browser". I figure it has something to do with the base folder of the application artificially changing because that's what several other errors were caused by, but I don't know how to resolve it.
How should I have configured IIS to use the subfolder of a web application as its base folder?