asp.net-coremethodnotfound

asp.net core project occurs MissingMethodException


I create a new project with ASP.NET Core Web Application(.NET Core). And it can work after building and running it.

I create a class library with .NET Core and move the files under Service folder in the web project to the library, then add the reference and change namespace in the controllers.

It occurs MissingMethodException after registering a new user.
Asp.net core project seems not able to use class library outside the web project.

The detailed message is as the below.

enter image description here


Solution

  • In ASP.NET Core , everything is in form of nuget packages, hence you might have to create nuget package from the class library and then add it to the current solution.

    Hope this information helps.