Break points will not hit (MEF-related)

Topics: Web Api
Nov 26, 2011 at 6:03 PM

I´m quite new with MEF. But shouldn´t it be possible to debug exported MEF service components?

My break points will not be hit since i´ve tested an MEF-based configuration...

What to do?

 

void Application_Start(object sender, EventArgs e)
        {
            //// Code that runs on application startup

            // use MEF for providing instances
            var catalog = new AssemblyCatalog(typeof(Global).Assembly);
            var container = new CompositionContainer(catalog);
            var config = new MefConfiguration(container);
            config.EnableTestClient = true;
            RouteTable.Routes.SetDefaultHttpConfiguration(config);
            
            config.Formatters.AddRange(new HalMediaTypeFormatter(Domain.AdditionalNamespaces), new CalendarFormatter());
            config.MessageHandlerFactory = container.GetExportedValues<DelegatingHandler>;

            RouteTable.Routes.SetDefaultHttpConfiguration(config);
            // Extension to map all APIs automatically with
            // the DefaultHttpConfiguration
            RouteTable.Routes.AutoMapServiceRoutes();
        }

 

 

Thanks,

Jakob