Using statement cannot be used inside a constructor?

Elements latest 2743, Island/VS2019. I got a build error saying “Element not allowed before the inherited constructor has been called

Is this expected? And we shouldn’t use using statement inside a constructor?

ConsoleApplication.7z (1.4 KB)

i dont think its a good idea to do this, the constructor should just be about constructing your classes. ie Passing in or defaulting values in the class

1 Like

You can’t have try/finally statements in the ctor before the inherited call. CLR rules. Using, for/each & co imply a try/finally.