So, I have a ViewModel in the "models" folder of my Mvc project with the namespace "Web.Models" (My Mvc project is called "Web"). I think it is worth noting that I have 3 more projects in my solution: Domain, Test and Tasks. Representation models are assigned properties from classes in my Domain.Entities folder. I can create a new instance of my viewmodel in my controller when I add a namespace in my controller.
using Web.Models;
However, when I create a view, it cannot import the namespace. This actually prompts me to add a namespace via "alt + enter" or "ctrl + dot", and it still says that it cannot resolve the object.
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Web.Models.MyViewModel>" %>
I also tried adding a global namespace reference in my Web.config, but with no luck. Any suggestions?
Justin soliz
source share