Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET MVC 2 Preview 1 - Problem compiling StructureMap Controller Factory
    text
    copied!<p>I have a project for which I use StructureMap for dependency injection. The project compiles fine as a MVC project but after moving everything to a MVC2 project I am now receiving the following error:</p> <blockquote> <p>Test.Web.Controllers.StructureMapControllerFactory.GetControllerInstance(System.Type)': no suitable method found to override C:\Test\Web\Controllers\StructureMapControllerFactory.cs 11 40 Test.Web</p> </blockquote> <p>Here is my StructureMapControllerFactory:</p> <pre><code>using System; using System.Web.Mvc; using StructureMap; namespace Test.Web.Controllers { public class StructureMapControllerFactory : DefaultControllerFactory { protected override IController GetControllerInstance(Type controllerType)** { IController result = null; try { if (controllerType == null) return base.GetControllerInstance(controllerType); result = ObjectFactory.GetInstance(controllerType) as Controller; } catch (StructureMapException) { System.Diagnostics.Debug.WriteLine(ObjectFactory.WhatDoIHave()); throw; } return result; } } } </code></pre> <p>I have found one post semi-related to this issue but it did not offer any insight as to how to resolve my issue: <a href="https://stackoverflow.com/questions/1212087/mvc-2-preview-1-methods-with-parameters-in-the-controller-fail-to-load">MVC 2 preview 1 - methods with parameters in the controller fail to load</a></p> <p>Obviously I must be missing a change from the 1.0-2.0 progression, but I am not sure what changed. Any help is always appreciated.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload