My view is having trouble finding a class located in one of my links. This link is to a DLL built outside the project.
An error always appears in the view:
The type or namespace name 'Company' was not found (you are missing the using directive or assembly reference)
Here is the controller. No problems.
using Company.Entities; public ActionResult Find() { Person test = Person.SelectByADDistinguishedName("L*", false); return View(test); }
Here is a view. The error occurs in the @Model line.
@model Company.Entities.Person @{ ViewBag.Title = "Bob"; } <h2>Find</h2>
My views /Web.config currently look like
<system.web.webPages.razor> <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> <pages pageBaseType="System.Web.Mvc.WebViewPage"> <namespaces> <add namespace="System.Web.Mvc" /> <add namespace="System.Web.Mvc.Ajax" /> <add namespace="System.Web.Mvc.Html" /> <add namespace="System.Web.Routing" /> <add namespace="Company.Entities" /> </namespaces> </pages> </system.web.webPages.razor>
I checked similar streams, such as one , but to no avail.
Here is the message on the screen
Line 25: using System.Web.Mvc.Html; Line 26: using System.Web.Routing; Line 27: using Company.Entities; Line 28: Line 29: Source File: c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET
Files \ root \ 49c9c7db \ 1f9dd5c8 \ App_Web_find.cshtml.a8d08dba.xro6gxci.0.cs Line: 27
If I expel any mention of the assembly (from web.config - no @using statments). I get the same error message while loading, but against this line
public class _Page_Views_Home_Find_cshtml : System.Web.Mvc.WebViewPage<Company.Entities.Person> {
reference c # asp.net-mvc asp.net-mvc-3
Lareau
source share