I'm just starting out with Catel in a Windows RT application and I have run into an issue.
I'm running into an exception when trying run a unit test against a Catel ViewModel. If I make a new Catel Win8 project and also make a Win8 Unit Test project, add a reference to the Win8 project and try instantiating the MainPageViewModel, I receive the following
Test method UnitTests.UnitTest1.TestMethod1 threw exception:
System.TypeInitializationException: The type initializer for 'Catel.Reflection.ReflectionExtensions' threw an exception. ---> System.Exception: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD))
at Catel.Caching.CacheStorage`2..ctor(Boolean allowNullValues)
--- End of inner exception stack trace ---
at Catel.Reflection.ReflectionExtensions.GetConstructorsEx(Type type)
at Catel.IoC.TypeFactory.CreateInstance(Type typeToConstruct)
at UnitTests.UnitTest1.TestMethod1() in UnitTest1.cs: line 16
Is there a different way of creating an instance that should be used in this case? I've tried just making a new instance and using the TypeFactory CreateInstance method with the same result.