Why does moving classes into a new folder in Visual Studio break things?
صفحه اصلي

Why does moving classes into a new folder in Visual Studio break things?

I have an ASP.NET application with three areas. In the root of the application is a Models folder containing a hodgepodge of classes, including two DataContexts, some Repository classes, some ViewModel classes, some helper classes, and some business logic classes.

I'd like to create subfolders for each of these subcategories and move the associated files into the appropriate subfolder. However, I am noticing that this is breaking things. For example, if I move one of the DataContexts to a DataContext subfolder in the Models folder, I find that the code in the repositories can no longer see the DataContext type.

Which must mean that the Models folder has special meaning to the system. What am I missing here? Is there some way to "sensitize" the subfolders so that the other code can still see the implemented classes and namespaces? Or am I going about this the wrong way?

ASP.NET MVC Form Submit with Link instead of Button


Using jquery to generate a Slug from Title (on lost focus)
Probably a namespacing issue? The model folder has no special meaning. Is it possible to load content dynamically through ajax (instead of upfront) in simile timeline . Error when Saving into SQL Server The ASP.NET MVC team has said any thing like before: . ASP.NET MVC iframe load "The only reason the model folder exists is for the reason this people kept asking us where to put our model classes" ;). ASP.NET ActionFilters and inheritance
Constructing controller action URL within JQuery AJAX call

78 out of 100 based on 28 user ratings 508 reviews