I am new to ASP.NET MVC and I am creating a project. First, I created all my models and data access in one project. However I now moved them into separate projects like this:
I updated all the import and for the models it works fine however when I try and update the imports for the ApplicationDBContext
which is stored in the DataAccess
project it seems as though it's not there and I get an error that it could not be found.
I tried to add project reference to the DataAccess
, but every time I do the tick box gets removed when I reopen the project references.
Does anyone know how to fix this problem? Thanks
There are few things to investigate and actions:
Sometimes Visual Studio does not warns about circular dependencies, so make sure DataAccess project does not have reference to web project
Another option is to restart Visual Studio (and optionally remove .vs folder).
As a last resort I sometimes modify csproj
files manually (just copy one of existing references in csproj
XML and change project name).