Caliburn.Micro icon indicating copy to clipboard operation
Caliburn.Micro copied to clipboard

Universal App - UnitTestProject can't start if having references to project using Caliburn.Micro

Open rongchaua opened this issue 9 years ago • 4 comments

Hi all, I'm trying Caliburn.Micro in Universal App. I have a main project using Caliburn.Micro and I would like to create a UnitTestProject to test some functions in that main project. Therefore in UnitTestProject I make a reference to main project. Since then the UnitTestProject can't start anymore, I always receive an error message "Cannot deserialize XBF metadata type list as 'CaliburnApplication' was not found in namespace 'Caliburn.Micro'".

20-10-2015 21-21-11

How can I fix this error? I also prepared a small demo. The unit test in demo can't run anymore. http://hintdesk.com/Web/Tmp/CaliburnMicroTest.zip

rongchaua avatar Oct 20 '15 19:10 rongchaua

This looks a lot like PrismLibrary/Prism#140 .

Adding the Bindable attribute in to your repro gets the unit test running.

[Bindable]
public sealed partial class App

Not sure yet if adding the attribute to CaliburnApplication will help yet, need to do some more testing.

nigel-sampson avatar Oct 20 '15 21:10 nigel-sampson

Hoping this is resolved in upcoming version of Windows / Visual Studio.

nigel-sampson avatar Nov 15 '15 22:11 nigel-sampson

I have the same error after upgrading caliburn.micro to 3.0.0 beta2 and change sdk behaviors with Microsoft.Xaml.Behaviors.Uwp.Managed. In my case, the problem resolved by restoring old Behaviors SDK and XAML.Interactions / XAML.Interactivity.

Hope this helps!

MichaelGulliver avatar Dec 01 '15 12:12 MichaelGulliver

Adding Bindable attribute to my App class resolved this issue for me as well.

However, this attribute triggers a MyUnitTestProject\obj\x86\Debug\XamlTypeInfo.g.cs file to be generated in a way that causes this exception to be thrown when debugging tests:

An exception of type 'System.Exception' occurred in Caliburn.Micro.Platform.UWP.dll but was not handled in user code

Additional information: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))

   at Windows.UI.Xaml.Application..ctor()
   at Caliburn.Micro.CaliburnApplication..ctor()
   at My.WindowsMobile.UI.App..ctor()
   at My.WindowsMobile.UnitTest.My_WindowsMobile_UnitTest_XamlTypeInfo.XamlTypeInfoProvider.get_OtherProviders()
   at My.WindowsMobile.UnitTest.My_WindowsMobile_UnitTest_XamlTypeInfo.XamlTypeInfoProvider.CheckOtherMetadataProvidersForName(String typeName)
   at My.WindowsMobile.UnitTest.My_WindowsMobile_UnitTest_XamlTypeInfo.XamlTypeInfoProvider.GetXamlTypeByName(String typeName)
   at My.WindowsMobile.UnitTest.App.GetXamlType(string fullName = "Windows.Foundation.IReference`1<Windows.UI.Xaml.Automation.Peers.AccessibilityView>")

technicallyerik avatar Aug 24 '16 20:08 technicallyerik