File Handling C#

Hello,
When I am trying to use the code of the C# example „WriteFile.cs“ I get the following error:
image.pngI am using version 2022.6 of the Toolchain and VS extension and on the top I include the following:
image.pngAlso please note I am using a „Program“ and not a „Function Block“.
Is there any way to fix this or an alternative way to use the code?
Thank you in advance.

Hi, it looks like the code in WriteFile.cs uses the Utils class that is defined here:
CSharpExamples/Utils.cs at master · PLCnext/CSharpExamples Collection of various C# sample code for PLCnext Technology controllers. - CSharpExamples/Utils.cs at master · PLCnext/CSharpExamples If you copy that Utils class definition into WriteFile.cs, that should work.
I have opened an issue in the Github project, here:
WriteFile example seems to be missing a class reference · Issue #18 · PLCnext/CSharpExamples Reported in the PLCnext Community, here: https://www.plcnext-community.net/forum/#/discussion/3308/file-handling-c The C# code in the following file (part of the File Handling example) references a…

Yes it works now, thank you once again!