|
I found the answer myself. Here is the solution.
The problem tuned out to be in the bootstrapper.
First you need the DLL. Add this to the Customers ClassLibrary Compile Build Events xcopy /Y /I "$(TargetPath)" "$(SolutionDir)$(SolutionName)\$(OutDir)"
It will put a copy of the DLL in the Bin. Now add a reference to the Customers.DLL in the Shell Project.
Next you need to search the bin for Exports in the bootstrapper: sonething like this:
Dim VLPAssyList = New List(Of Assembly) Dim dir = New DirectoryInfo(".") VLPAssyList.AddRange(dir.GetFiles( "Protected Overrides Function SelectAssemblies() As System.Collections.Generic.IEnumerable(Of System.Reflection.Assembly) Dim assyList = New List(Of System.Reflection.Assembly) From {System.Reflection.Assembly.GetExecutingAssembly()}(Customerss.dll").Select(Function(x) Assembly.LoadFile(x.FullName))) .....
Here is the part that was making me tear my hair out. I was missing the fact that just adding the Exports to the catalog was not enough so . . .
And last you need to Not only find and add the Exports to the catalog above, but for a Master/Detail as shown in the Hello Screens Customers example you need to add this line to your Configure Sub:
batch.AddExportedValue(Of
Func(Of
Customers.CustomerViewModel))(Function()
container.GetExportedValue(Of Customers.CustomerViewModel)())
Hope this helps anyone else who is new to MEF and CM get started with major sections of a solution organixed in seperate projects.
Bob
|