I have the same problem and I am not using Glimpse and I solve the problem as follows:
In the commentary on the ProjectName\Areas\HelpPage\Controllers\HelpController.cs constructors, since it is not called the implicit constructor of public HelpController() : this(GlobalConfiguration.Configuration) by default, is called the constructor with the parameter public HelpController(HttpConfiguration config) , and this initializing the Configuration property is an instance. And you can solve this problem as follows:
Solution 1: Comment / Delete Constructors.
public class HelpController : Controller { private const string ErrorViewName = "Error"; // public HelpController() // : this(GlobalConfiguration.Configuration) // { // } // public HelpController(HttpConfiguration config) // { // Configuration = config; // } /// <summary> /// GlobalConfiguration By default /// </summary> protected static HttpConfiguration Configuration { get { return GlobalConfiguration.Configuration; } } public ActionResult Index() { ViewBag.DocumentationProvider = Configuration.Services.GetDocumentationProvider(); return View(Configuration.Services.GetApiExplorer().ApiDescriptions); } ....
Solution 2: Insert the default constructor by adding this [InjectionConstructor] attribute.
public class HelpController : Controller { private const string ErrorViewName = "Error"; [InjectionConstructor] public HelpController() : this(GlobalConfiguration.Configuration) { } public HelpController(HttpConfiguration config) { Configuration = config; } /// <summary> /// GlobalConfiguration By default /// </summary> protected static HttpConfiguration Configuration { get; private set; } ....
And the problem is solved.
Totpero
source share