I have an issue refrerencing an assembly in a view for MVC. This namespace is part of a dll I have as part of the project, it works fine but if I use anything derectly from it inside a view it gives the below:
An error occurred during the compilation of a resource required to process this request. Please review the following specific error details and modify your source code appropriately.
/Views/User/Tasks.cshtml
The type 'TaskType' is defined in an assembly that is not referenced. You must add a reference to assembly 'HRServiceCalls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
If I then ref the assembly in _ViewImports.cshtml I get the below.
An error occurred during the compilation of a resource required to process this request. Please review the following specific error details and modify your source code appropriately.
/Views/_ViewImports.cshtml
The type or namespace name 'HRServiceCalls' could not be found (are you missing a using directive or an assembly reference?)
@using HRServiceCalls
I even added the ref to web config to no avail.
<system.web>
<compilation debug="true">
<assemblies>
<add assembly="HRServiceCalls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</assemblies>
</compilation>
</system.web>
Can anyone point out what I need to do to get this ref working in views. The models and controllers have no issue with it.