I am having horrible trouble debugging a MVC ASP.NET webpage deployed to IIS. The website works perfectly on localhost on the PC where it has been made. When I navigate to the page on a different PC on the same network however, I get this error :
Further inspection with Fiddler2 gives me the following information, the only debug information I can seem to get from this solution:
Here is the Layout.cshtml :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title - Intranet Page</title>
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/Scripts/application.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<header>
<div class="content-wrapper">
<div class="float-left">
<p class="site-title">@Html.ActionLink("IntranetPage", "Index", "Home")</p>
</div>
<div class="float-right">
<!-- <section id="login">
</div>
<div id="logindisplay">
Context.User.Identity.Name <strong>@Context.User.Identity.Name</strong>!
</section> This works correctly to get DOMAIN/USERNAME-->
</div>
</div>
</header>
<div id="body">
@RenderSection("featured", required: false)
<section class="content-wrapper main-content clear-fix">
@RenderBody()
</section>
</div>
@Scripts.Render("~/bundles/jquery")
@RenderSection("scripts", required: false)
</body>
</html>
And the index page in question :
@model IEnumerable<WhoIs.Models.Employee>
@{
ViewBag.Title = "Contoso Employees";
}
@section featured {
<section class="featured">
<div class="content-wrapper">
<hgroup class="title">
<h1>@ViewBag.Title.</h1>
</hgroup>
</div>
</section>
}
<label for="filter">Enter employee details here : </label>
<input type="text" name="filter" value="" id="filter" />
<h2><strong>Users</strong> (<a href="/home/create" style="color: blue;">create new</a>)</h2>
<br />
<div style="min-height: 150px; font-size: 1.25em">
<div style="margin-bottom: .5em">
<table><thead><tr><th>Name</th><th>Branch</th><th>Phone No.</th><th>Username</th><th>Email</th></tr></thead>
<tbody>
@foreach ( var prod in Model )
{
<tr>
<td>@prod.FullName</td>
<td>@prod.Branch</td>
<td>@prod.PhoneNo</td>
<td>@prod.DomainAC</td>
<td>@prod.Email</td>
@if (User.IsInRole(@"Admins") || User.Identity.Name == prod.DomainAC) {
<td><a href="/home/edit/@prod.Id" style="color: blue;">edit</a></td>
}else{
<td>User => @User.ToString()</td>
}
</tr>
}
</tbody>
</table>
</div>
</div>
These render a simple page with a list of employees at Contoso, giving Admins and users themselves the ability to edit their details. Can anyone see what may be causing my problem here ? I have investigated this thoroughly with no results.
I have a .edmx file added to my models folder which is linked to the remote database Employees. I have tried to edit the web.config to give more information on what may be the problem by adding the lines :
But I am still only getting the error message above.
Can anyone tell me what may be causing this problem please ? Commenting out the section where I retrieve from the database gets rid of the error, but I cannot solve it.
Thanks a lot.
Edit :
Web.config extract :
<system.web>
<compilation debug="true"/>
<deployment retail="false" />
<customErrors mode="Off">
</customErrors>
<httpHandlers>
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
</httpHandlers>
<pages
validateRequest="false"
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxx"
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxx"
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxxx">
<controls>
<add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxxxx" namespace="System.Web.Mvc" tagPrefix="mvc" />
</controls>
</pages>
</system.web>