When you get the above exception after running your WebAPI follow the below steps to resolve the error
method write the below line of code.
method write the below line of code.
just open the Global.asax.cs class and under the Application_Start()
public class WebApiApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
GlobalConfiguration.Configure(WebApiConfig.Register);
GlobalConfiguration.Configuration.EnsureInitialized(); //add this line
}
}
No comments:
Post a Comment