0

For example:

I have a LogModel for writing logs to the database in each of five projects under one solution. They're all the same, so if I edit I have to edit each manually.

Now I know I can reference it like "OtherProject.Models.LogModel", but when I deploy each application to different servers where they don't know about one another, will the LogModel be bundled in each one, or will it just error now that it doesn't know how to complete that reference?

Thanks for any guidance! I'm using MVC 4 btw.

Josh Dean
  • 1,593
  • 2
  • 11
  • 17

1 Answers1

3

The shared project's resulting dll needs to be deployed with each server. When you compile in VS it will copy the dll from the shared'd projects bin directory to each dependent project's bin directory automatically.

Samuel Neff
  • 73,278
  • 17
  • 138
  • 182
  • That's awesome thanks. For best practice, would it be best to make another project in the solution only for holding a library of these models? If so, how would I go about this? I see an option for 'class library' – Josh Dean Oct 01 '13 at 01:05
  • 2
    @JoshDean, yes, best practice is to put "shared" classes in a library designated as such. It's also often good to separate data classes that just hold data from classes with real functionality in them, especially as solutions grow. – Samuel Neff Oct 01 '13 at 01:07