title: Could not load type System.Web.Mvc.ViewUserControl<somethig>
body: <p>I spend all day trying to find the solution. I found some but none of it worked for me. Long short the application I am working on is being upgraded from MVC3 (I believe) to MVC5 and ASP.NET Version 4.6.1. The upgrades were being done by some other developer and now I have to fix all issues and bugs he left. The issue I am facing is that I can't load strongly typed view. I invoke the action method from my main view:</p>
  
  <pre><code>&lt;div id="fromLocationEditPartial"&gt;
       @Html.Action("FormLocationEdit", "Shared", new { area = "Shared", options = Model.LocationID });
  &lt;/div&gt;
  </code></pre>
  
  <p>Here is the action method code I am calling:</p>
  
  <pre><code> public ActionResult FormLocationEdit(int? options)
      {
          LocationEditorModel model = new LocationEditorModel();
  
          //DTLocationAutoMetadata locObj;
          DTLocation locObj;
  
          if (options.HasValue)
          {
              int locationID = options.Value;
              //locObj = AutoMapper.Mapper.Map&lt;DTLocation, DTLocationAutoMetadata&gt;(entities.DTLocation.Where(m =&gt; m.LocationID == locationID).FirstOrDefault());
              locObj = entities.DTLocation.Where(m =&gt; m.LocationID == locationID).FirstOrDefault();
  
              if (locObj == null)
              {
                  locObj = new DTLocation();
                  locObj.SelectLocation = new SelectList(model.GetListOfLocations(), "Value", "Text");
              }
              else
              {
                  locObj.SelectLocation = new SelectList(model.GetListOfLocations(), "Value", "Text", locObj.SiteID);
              }
          }
          else
          {
              locObj = null;
          }
  
          return View("~/Areas/Shared/Views/FormLocationEdit.ascx", locObj);
      }
  </code></pre>
  
  <p>Here as you can see it suppose to return the strongly typed view with object. 
  Here is how my shared view looks like:</p>
  
  <pre><code>&lt;%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl&lt;CMDBv3.DTLocationAutoMetadata&gt;" %&gt;
  &lt;script type="text/javascript"&gt;
     $(document).ready(function () {
      //BindSubmitActions('formLocationEdit');
     })
  &lt;/script&gt;
  &lt;% using (Html.BeginForm("FormLocationEdit", "Shared", FormMethod.Post,  new { area="Shared", id = "formLocationEdit" })) {%&gt;
  ***here is the condition if (Model!=null) do something else display model data***
  </code></pre>
  
  <p>In my VS Error list I am having errors:</p>
  
  <blockquote>
    <p>Error 4   The name 'Model' does not exist in the current context
    Error 2   The name 'Html' does not exist in the current context</p>
  </blockquote>
  
  <p>When I run the proj I am getting inner exception:</p>
  
  <blockquote>
    <p>Could not load type System.Web.Mvc.ViewUserControl"&lt;"CMDBv3.DTLocationAutoMetadata">"</p>
  </blockquote>
  
  <p>As I understand it is some issues with versioning but I checked all my web.config and it seems that version is fine there. Can someone give me some advice what else could it be if it is not web.config issue? </p>