Debug PRISM 4.0 Application

Topics: Prism v4 - WPF 4
Oct 24, 2011 at 1:27 PM

Hi,

I am newbie and trying to learn couple of things at same time in .Net world (e.g. PRISM, DI, WPF, etc.)

I am trying to learn by creating an application which similar to Stock Trader RI using WPF.

 

I have created all required classes of PositionSummary in Position module. The issue is that when I have a constructor like this:

[ImportingConstructor]
public PositionSummaryViewModel(IEventAggregator eventAggregator, IObservablePosition observablePosition)
{
// Doesn't work
}

My view is not injected. But if I have a constructor like this where I remove the last parameter in the constructor it works fine.

 

[ImportingConstructor]
public PositionSummaryViewModel(IEventAggregator eventAggregator)
{
//Works fine...
}

It looks as DI container is not able to instantiate the IObersvablePosition object...

The thing is how can I debug to figure out the exact problem? I don't see any exception being thrown...  It will be great if someone can explain how should I debug so, that I understand why DI container is failing and how can I fix it...

Any help or guidance will be appreciated.

Regards,

//R

 

Developer
Oct 24, 2011 at 2:52 PM
Edited Oct 25, 2011 at 1:04 PM

Hi,

Debugging problems in MEF can be difficult. You might find useful information regarding that in the following links:

I hope you find this helpful.

Agustin Adami
http://blogs.southworks.net/aadami


Oct 25, 2011 at 11:22 AM

Thanks for sharing information Agustin. Highly appreciated.

I am kind of still stuck... do you know any resources from where I can learn about MEF?

Regards,

//R

 

Developer
Oct 25, 2011 at 1:49 PM

Hi,

You could find more information in the MEF community site, there you will find more documentation, discussions and resources that might help you.  

Also you might find some samples in the Prism Training Kit: MEF lab.

Regards,

Agustin Adami
http://blogs.southworks.net/aadami