Dela via


Kompilatorfel CS0724

En utkastsinstruktion utan argument tillåts inte i en slutsats som är kapslad i närmaste omslutande catch-sats

Exempel

I följande exempel genereras CS0724 på grund av -instruktionen throw i satsblocket finally :

// CS0724.cs  
using System;  
  
class Program
{
    static void Test()
    {
        try
        {
            throw new Exception();
        }
        catch
        {
            try
            {
            }
            finally
            {
                throw; // CS0724
            }
        }
    }

    static void Main()
    {
    }
}