locked
Unit testing windows store app fails when style contains custom attached dependency properties RRS feed

  • Question

  • Hi,

    When trying to run unit tests (the UITestMethod variant) I am getting an error such as this:

    Failed to activate Windows Store app unit test executor. Error: The remote procedure call failed.

    After a lot of head ache trying to figure this out, I've narrowed it down to the following:

    When I use a custom attached dependency property on a control inside a style like this:

    <TextBox VerticalAlignment="Top" ui:ContextField.ForceHelp="True"/>

    the actual error message is

    A first chance exception of type 'System.NotImplementedException' occurred in vstest.executionengine.appcontainer.x86.exe

    at Microsoft.VisualStudio.TestPlatform.TestExecutor.AppContainer.RunTimeXamlSystemBaseType.IsConstructible.get()

    (this comes from switching to mixed mode debugging).

    Removing the attached property makes the unit test run.

    The attached property is implemented like this:

    public static bool GetForceHelp(DependencyObject obj)
            {
                return (bool)obj.GetValue(ForceHelpProperty);
            }
    
            public static void SetForceHelp(DependencyObject obj, bool value)
            {
                obj.SetValue(ForceHelpProperty, value);
            }
    public static readonly DependencyProperty ForceHelpProperty =
                DependencyProperty.RegisterAttached("ForceHelp", typeof(bool), typeof(ContextField), new PropertyMetadata(false));

    Is this a bug or am I doing something horribly wrong?


    Wednesday, March 26, 2014 4:41 PM

Answers

  • Thank you:) 

    I've added a bug report here: http://connect.microsoft.com/VisualStudio/feedback/details/848688/unit-testing-windows-store-app-fails-when-style-contains-custom-attached-dependency-properties

    • Proposed as answer by Amanda Zhu Wednesday, April 9, 2014 1:28 AM
    • Marked as answer by Amanda Zhu Wednesday, April 9, 2014 1:32 AM
    Tuesday, April 8, 2014 9:42 AM

All replies

  • Hi,

    Because we are not Windows Store app developer, it is hard for use to repro this issue on our side, could you please provide us a sample which can be used to run on our side? Please attach a windows store app as a sample and your test project, upload them to OneDrive: https://onedrive.live.com/  (or send it to my mailbox:v-amanz@microsoft.com ) and then post the download link here.

    In addition, please tell us which version of Visual Studio you use.

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, March 27, 2014 5:13 AM
  • Here's a sample that should reproduce the problem. Just run the unit test in this solution and you should get the same RPC error message.

    Sample

    Microsoft Visual Studio Ultimate 2013
    Version 12.0.30110.00 Update 1
    Microsoft .NET Framework
    Version 4.5.51641

    Thanks


    • Edited by Frode Hus Thursday, March 27, 2014 8:30 AM
    Thursday, March 27, 2014 8:28 AM
  • Hi Frode,

    Thank you for your detailed information. Based on your sample, I can repro your issue. Because the issue is related to Windows Store technology, I am not a Windows Store developer, I suggest getting the issue confirmed and diagnose by product team. Would you please create connect report for it? You will get email notification for update.http://connect.microsoft.com/VisualStudio/feedback/CreateFeedback.aspx, if you submit it, you could share us the link here, so we could know the latest information from the Product team expert. And I will help you to vote it.

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, March 31, 2014 6:04 AM
  • Thank you:) 

    I've added a bug report here: http://connect.microsoft.com/VisualStudio/feedback/details/848688/unit-testing-windows-store-app-fails-when-style-contains-custom-attached-dependency-properties

    • Proposed as answer by Amanda Zhu Wednesday, April 9, 2014 1:28 AM
    • Marked as answer by Amanda Zhu Wednesday, April 9, 2014 1:32 AM
    Tuesday, April 8, 2014 9:42 AM
  • Hi Frode,

    Voted it. Since we have reported this issue to Microsoft product team, then it is in their support range. I will mark the reply including Microsoft Connect link as a temporary 'answer' to close this thread on forum side. Meanwhile I will pay attention to the Microsoft Connect continuously, once an answer is provided, I will post in this thread.

    Thank you for your understanding.

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, April 9, 2014 1:32 AM