1- Vous pouvez l'enlever comme ceci:
try
{
doSomething()
}
catch (AmbiguousMatchException)
{
doSomethingElse()
}
2- Utilisez avertissement désactiver comme ceci:
try
{
doSomething()
}
#pragma warning disable 0168
catch (AmbiguousMatchException exception)
#pragma warning restore 0168
{
doSomethingElse()
}
Autre avertissement familier désactivé
#pragma warning disable 0168 // variable declared but not used.
#pragma warning disable 0219 // variable assigned but not used.
#pragma warning disable 0414 // private field assigned but not used.