Resolving view when view model is a proxy

Topics: Bootstrappers & IoC, Conventions
Aug 29, 2011 at 6:24 PM

I'm using Castle DynamicProxy for dirty tracking on my view models, but I'm not sure how to go about configuring CM to resolve my views.

At runtime, I get an error like this:

"Cannot find view for ICreateAlertViewModelProxy27fca3f07..."

I haven't done any work with override the default conventions in CM yet.  Is that how you would go about solving this?

Paul Schofield

Aug 30, 2011 at 4:31 AM

My quick thought is to add a NameTransformer rule (see

I think something like

NameTransformer.AddRule(@"ModelProxy.+$", string.Empty);

would do the trick.  It should resolve to "ICreateAlertView" in your case.