0

Is anyone else having problems getting VS2013 to recognize Models from an external class library? I really don't want to have to manually create every view and every Action when adding new Controllers and Views. My ViewModels are also in an external .dll so the only option I really have is creating new ViewModels in current project and use some sort of AutoMapper to reduce grunt work. Thanks in advance.

Here is screen shots:

1. Add Controller:

enter image description here

2. Recognize Model and Context

enter image description here

Solution

Thanks to Sarbanjeet I thought I would share the steps taken. The projects must be referenced in order to perform the typical Add Views/Controllers with CRUD using EF in VS2013.

1. Add Existing Project enter image description here

**2. Add Reference (csproj) not dll enter image description here

  1. Rebuild Main Project**

This makes sense since the class dll only contains the compiled classes while the project file contains data on the project itself.

Community
  • 1
  • 1
yardpenalty.com
  • 1,244
  • 2
  • 17
  • 32

1 Answers1

1

Include external library dll in References folder using these steps.

  1. Right click on References folder.
  2. Click on Add Reference.
  3. Then browse the project library and add it to references folder(Remember project reference not class reference).
  4. Clean solution and rebuild it or unload project and reload it.
  5. If no luck, try these methods Click here
Community
  • 1
  • 1
Sarbanjeet
  • 253
  • 1
  • 15
  • Thanks a ton Sarbanjeet~! You would think you wouldn't have to reference the project itself, but it makes sense as to why you have to do this. – yardpenalty.com Dec 27 '14 at 04:11