Problems with samples (latest version)

Oct 10, 2011 at 3:21 PM

I got the latest samples from CodePlex and ran into some problems

(- Studio complained about included dll's coming from the Web (had to unlock them)

- Got some weird errors about *.g.i.cs files. Solved that by cleaning solution + deleting all Obj folders)

- Running Catel.Examples.SL4.AdvancedDemo results in an exception:

System.InvalidCastException: Unable to cast object of type 'System.Collections.ObjectModel.Collection`1[System.Lazy`1[System.Object]]' to type 'System.Collections.Generic.IEnumerable`1[System.Object]'.
   at Catel.IoC.MefHelper.GetExportsFromKey(Object container, String key)
   at Catel.IoC.MefHelper.IsTypeRegistered(Object container, Type interfaceType)
   at Catel.IoC.ServiceLocator.IsTypeRegistered(Type interfaceType)
   at Catel.IoC.ServiceLocator.RegisterType(Type interfaceType, Type implementingType, Boolean registerIfAlreadyRegistered, Object originalContainer)
   at Catel.IoC.ServiceLocator.RegisterType[TInterface,TImplementation](Boolean registerIfAlreadyRegistered)
   at Catel.IoC.ServiceLocator.RegisterTypeIfNotYetRegistered[TInterface,TImplementation]()
   at Catel.MVVM.ViewModelBase.RegisterViewModelServices(IServiceLocator serviceLocator)
   --- End of inner exception stack trace ---
   at Catel.MVVM.ViewModelBase.RegisterViewModelServices(IServiceLocator serviceLocator)
   at Catel.MVVM.ViewModelBaseWithoutServices..ctor(Dictionary`2 services, Boolean supportIEditableObject, Boolean ignoreMultipleModelsWarning, Boolean skipViewModelAttributesInitialization)
   at Catel.MVVM.ViewModelBase..ctor(Dictionary`2 services, Boolean supportIEditableObject, Boolean ignoreMultipleModelsWarning, Boolean skipViewModelAttributesInitialization)
   at Catel.MVVM.ViewModelBase..ctor(Dictionary`2 services, Boolean supportIEditableObject, Boolean ignoreMultipleModelsWarning)
   at Catel.MVVM.ViewModelBase..ctor(Dictionary`2 services, Boolean supportIEditableObject)
   at Catel.MVVM.ViewModelBase..ctor(Dictionary`2 services)
   at Catel.MVVM.ViewModelBase..ctor()
   at Catel.Examples.AdvancedDemo.ViewModels.MainWindowViewModel..ctor()}

Oct 10, 2011 at 4:40 PM

Thanks for letting us know. I have updated the examples and removed the libraries from source control (now using NuGet in combination with Pepita). Please let me know if your problems are solved.

Oct 10, 2011 at 5:28 PM

Never seen any open source project with such a quick response to questions! Impressive...

I just tried it but got a "407 Proxy authentication required" during the build when it tries to automatically download Catel 2.2. Company firewals :-(

Will try it later from home and let you know.

GeertD.

 

Oct 10, 2011 at 8:59 PM

The Nuget/Pepita combination does the trick. (I had some unfound references,but installing the Silverlight Toolkit solved these).

But:

1) there is still on build error (Caltel.Examples.WPF.BrowserApplication -> Unable to find manifest signing certificate in the certification store).

2) I still have the crash in Catel.Examples.SL4.AdvancedDemo (see my original post)

GeertD.

Oct 11, 2011 at 7:30 AM

Thanks for the detailed information:

1) Fixed (was about signing the ClickOnce manifest), I needed a different machine to reproduce this issue

2) Works on my machine (several machines). Do you have SL5 installed? Or only the SL4 SDK?

Oct 11, 2011 at 7:51 AM

2) I only have the SL4 SDK installed.

Oct 11, 2011 at 9:40 AM

Strange, we have unit tests for the MefHelper in both SL4 and SL5, but still it seems to fail on your machine. We will investigate this further this evening.

Oct 11, 2011 at 11:56 AM

The error is even stranger, because a collection implements IEnumerable<object>. Do you have the SL4 toolkit installed? If not, maybe that's the cause. However, we don't want to force you to install the toolkit, so we will modify the casting strategy this evening.

Oct 11, 2011 at 12:31 PM

Yes I do have the SL4 toolkit (April 2010) installed.

To be sure I did not make a mistake last night, I just got the most recent version of the sample sources from codeplex (manifest problem solved) and verified that I still have that error, and I do.

Oct 11, 2011 at 4:21 PM

I have updated the beta version. You can find it here:

http://dl.dropbox.com/u/8455721/Catel%202.3%20beta.zip

Can you let me know if it works? Thanks!

Oct 11, 2011 at 4:58 PM

When I run the Catel.Examples.SL4.AdvancedDemo I still have the error...

I copied the dll's to the \Packages\Catel.core.2.2\net40, \Packages\Catel.silverlight.2.2\sl4 and \Packages\Catel.windows.2.2\net40 in the \src folder of the samples. I did a rebuild all of the samples.

A "view in browser" does show the UI but then also produces:

Line: 1
Error: Unhandled Error in Silverlight Application Failed to configure IoC container   at Catel.MVVM.ViewModelBase.RegisterViewModelServices(IServiceLocator serviceLocator)
   at Catel.MVVM.ViewModelBaseWithoutServices..ctor(Dictionary`2 services, Boolean supportIEditableObject, Boolean ignoreMultipleModelsWarning, Boolean skipViewModelAttributesInitialization)
   at Catel.MVVM.ViewModelBase..ctor()
   at Catel.Examples.AdvancedDemo.ViewModels.MainWindowViewModel..ctor()

All the other samples continue to work just fine.

Oct 12, 2011 at 9:26 PM

One thing that I did not mention yet is that I am trying this on a 64 bit Win7 machine.

Geert

Oct 13, 2011 at 7:57 AM

Maybe that's a point I should investigate (although SL4 doesn't support x64 yet). Thanks for letting me know.