VcDeveloper
VcDeveloper

Reputation: 413

ServiceLocator Current GetInstance?

I have assemblies discovered in a directory using MEF and they are loaded when needed during runtime when a user selects a menu.

The MainMenuListViewModel OnMainMenuSelectionChanged()

After a assembly is loaded each has its own UI and views can be added to it as the user needs them, but when I use excelView = ServiceLocator.Current.GetInstance(); I get an exception.

The ExcelController ShowExcelView()

Exception Details Exception Details on ServiceLocator.Current.GetInstance

How do I solved this problem, because I'm assuming directory discovered assembles are added to the AggregateCatalog so the ServiceLocator can find them right?

This is how the main IExcelView is setup: enter image description here

Upvotes: 2

Views: 3845

Answers (1)

VcDeveloper
VcDeveloper

Reputation: 413

I found the problem, I needed to add the Key I used to Export the class.

enter image description here

Upvotes: 1

Related Questions