The object already exists

0

I am writing a Windows Phone 8.1 App (WINRT). Sometimes my mainpage crashes and debugger doesnot even handle it. I tried applying try-catch to every line but it was not helping.

It happens sometimes and not always.

While debugging it directly goes into App.g.i.cs:

    #if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
            UnhandledException += (sender, e) =>
            {
                if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
            };
#endif
        }

e: {System.Collections.ListDictionaryInternal} {System.Exception: The object already exists. (Exception from HRESULT: 0x80071392)} Message = "The object already exists.\r\n"

Is it XAML problem? I checked every line of XAML, I didnt find any problem. How to solve this?

c#
xaml
windows-runtime
windows-phone
windows-phone-8.1
asked on Stack Overflow Feb 16, 2015 by Atif Shabeer

1 Answer

0

I read my code line by line and got the bug, I was trying to change the Pivot.SelectedIndex even before Pivot was enabled.

Thanks a lot guys

answered on Stack Overflow Feb 21, 2015 by Atif Shabeer

User contributions licensed under CC BY-SA 3.0