Click here to Skip to main content
15,887,246 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I'm going through the health section for my App on the Microsoft Developers Dashboard and the latest crash:

STOWED_EXCEPTION_System.InvalidOperationException_80131509_ReadTypeAndSpellWell.exe!Unknown 12/1/2015 1:10:09 AM

...and the link for this shows the following Call Stack:

Frame Image
Function Offset
1 System_Core_ni System.Linq.Enumerable.First[[System.__Canon,_mscorlib]] 0x115
2 ReadTypeAndSpellWell UNKNOWN 0x60
3 ReadTypeAndSpellWell UNKNOWN 0x59
4 ReadTypeAndSpellWell UNKNOWN 0x15
5 mscorlib_ni System.Collections.Generic.List_1[[System.__Canon,_mscorlib]].Find 0x37
6 ReadTypeAndSpellWell UNKNOWN 0x6D
7 ReadTypeAndSpellWell UNKNOWN 0x28
8 ReadTypeAndSpellWell UNKNOWN 0x42
9 mscorlib_ni System.Runtime.CompilerServices.AsyncMethodBuilderCore+__c._ThrowAsync_b__6_0 0x35
10 System_Runtime_WindowsRuntime_ni System.Threading.WinRTSynchronizationContext+Invoker.InvokeCore 0x24

I'm faily Ok at debugging within Visual Studio, but don't know where to start in determining if there is anything useful in this error and call stack to enable me to find the root cause of the crash.

Please could someone please help and point me in the right direction, if there is one.

Thanks in advance...
Posted

1 solution

OK, from the little information you provided, your code exploded on a LINQ query that involved a call to First(). Reading the documentation on the First() method, it says that for an InvalidOperationException to be thrown, you passed in a TSource that was empty.

Judging by the stack trace, that TSource would be a List object.
 
Share this answer
 
Comments
FrontrunnerSoftwareIreland 2-Dec-15 18:55pm    
Hi Dave,
Thanks for the quick response.

The only method to call First() in my program that involves a predicate is trying to find the best available english speaking voice as follows:

public static string GetBestAvailableVoiceId()
{
var voices = GetVoicesList();

// Get first British voice...
var britishVoice = voices.First(v => v.Language.Contains("en-GB"));
if (britishVoice == null)
{
// Get first English voice...
var englishVoice = voices.First(v => v.Language.Contains("en"));
if (englishVoice == null)
{
// No english voices available...
Helpers.ModalPopupMessage(
Helpers.GetString("PM/B/Audio/GetSynthesizer/Error"),
Helpers.GetString("PM/T/Audio/Speech"));
}
else
{
return englishVoice.Id;
}
}
else
{
return britishVoice.Id;
}

return _synthesizer.Voice.Id;
}

So is it a call to GetVoiceList() returning null that is causing the problem or one of the First() predicates that is failing somehow?
Dave Kreskowiak 2-Dec-15 20:22pm    
According to the documentation on First, it's the list being returned by GetVoicesList that is returning an empty List.
Sergey Alexandrovich Kryukov 2-Dec-15 19:31pm    
5ed.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900