Uploaded image for project: 'Spring.NET'
  1. Spring.NET
  2. SPRNET-1473

A call to SpringMvcDependencyResolver GetServices fails with a cast exception (DictionaryEntry -> Implementation)

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.2
    • Fix Version/s: 2.0 M1
    • Component/s: Spring-NET-WEBMVC
    • Labels:

      Description

      In SpringMvcDependencyResolver the method:

      public IEnumerable<object> GetServices(Type serviceType)

      will always fail.

      Instead of returning an object of the class asked for, it returns an DictionaryEntry, so instead of

      91: var services = ApplicationContext.GetObjectsOfType(serviceType);
      92: return services.Cast<object>();

      it should be

      91: var services = ApplicationContext.GetObjectsOfType(serviceType);
      92: return services.Values.Cast<object>();

      The issue was discovered here:
      http://stackoverflow.com/questions/7598279/how-to-do-spring-net-di-injection-in-action-filters-asp-net-mvc-3/

        Attachments

          Activity

            People

            • Assignee:
              sbohlen Steve Bohlen
              Reporter:
              andreask Andreas Kluth
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: