Nnamdi
Nnamdi

Reputation: 29

How can I access models from another solution in the same ASP.NET MVC 4 project

I have a project containing two solutions, I want to access some of the models in solution a when I was working on solution B. How can I access solution A's Models? Can anyone Help please

Upvotes: 0

Views: 1484

Answers (1)

cgijbels
cgijbels

Reputation: 6114

You can always add the SolutionA.ProjectWithModels.csproj as an existing project into SolutionB.

Just keep in mind that the Visual Studio will most likely warn you about the project not being part of SolutionB folder structure, but if you can guarantee that SolutionA.ProjectWithModels.csproj will always be available when opening SolutionB then that might be an option.

Another option could be to copy the generated SolutionA.ProjectWithModels assembly and reference it in SolutionB.Mvc4Project or maybe create a separate solution/project for those models and create a NuGet package from it which you can then install in SolutionB.Mvc4Project

Upvotes: 1

Related Questions