Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Catch clauses cannot follow the general catch clause of a try statement
A catch
block that does not take any parameters must be the last in a series of catch
blocks. For more information on exceptions, see Exceptions and Exception Handling.
The following sample generates CS1017:
// CS1017.cs
using System;
namespace x
{
public class b : Exception
{
}
public class a
{
public static void Main()
{
try
{
}
catch // CS1017, must be last catch
{
}
catch(b)
{
throw;
}
}
}
}
.NET feedback
.NET is an open source project. Select a link to provide feedback: