There are various remedies: one, if set to a string, the other, to call ToString on SelectedValue.
As you stated that some of the suggested answers do not work, are you sure that the element in Combobox is actually a string?
For example, this will work with the proposed fixes:
<Window x:Class="ExerciseOne.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525" xmlns:extern="clr-namespace:System;assembly=mscorlib">
<Grid>
<ComboBox SelectionChanged="ComboBox_SelectionChanged">
<ComboBox.Items>
<extern:String>Hello</extern:String>
<extern:String>Floyd-Warshall</extern:String>
</ComboBox.Items>
</ComboBox>
</Grid>
</Window>
But it will not be:
<Window x:Class="ExerciseOne.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525" xmlns:extern="clr-namespace:System;assembly=mscorlib">
<Grid>
<ComboBox SelectionChanged="ComboBox_SelectionChanged">
<ComboBox.Items>
<ComboBoxItem>Hello</ComboBoxItem>
<ComboBoxItem>Floyd-Warshall</ComboBoxItem>
</ComboBox.Items>
</ComboBox>
</Grid>
</Window>
, , :
MessageBox.Show(((ComboBox)sender).SelectedValue.GetType().ToString());