Sparksido
Sparksido

Reputation: 625

Error comes up when creating controller for ASP.Net Web API

I have just created a ASP.NET web API project with Visual Studio 17 and I have created a Class Library to connect it to an SQL database I created. the problem is when I try to create a controller in the project, I get the error,

There was an error running the selected code generator: could not load file 'ClassLibrary.dll' or one of it's dependencies. this system could not find the file specified.

Does anyone what the problem could be. I have looked at the folder where the said file should be contained in the ClassLibrary and it is empty.

I gather that it might be from my Entity Framework, I am using ADO.Net Entity Data Model.

Upvotes: 0

Views: 1443

Answers (2)

atish
atish

Reputation: 19

First you have to add reference of your class library project if you don't then just give a built to your project in which you added a reference of class library project, then try to create a controller it will definitely help you....

Upvotes: 1

Raja sekhar
Raja sekhar

Reputation: 135

For ASP.NET web API project no need to add Class Library:

  • Just right click in Solution and add ADO.net Model
  • Configure with Database
  • Add required Database Tables
  • Build solution

Upvotes: 1

Related Questions