C# compilation fails

ProjectDir\Sources\Main.hx:

class Main {
    public static function main() {
        trace("Hello World!");
    }
}

ProjectDir\build.hxml:

--cs Temp
--class-path Sources
--main Main

haxe build.hxml output:

haxelib run hxcs hxcs_build.txt --haxe-version 4000 --feature-level 1
File at path hxcs_build.txt not found

I’ve never compiled Haxe to C#. What am I doing wrong here?

What is hxcs_build.txt?

You should be able to compile with haxe build.hxml in ProjectDir

I’m doing ‘haxe build.hxml’ and it fails with this error:

haxelib run hxcs hxcs_build.txt --haxe-version 4000 --feature-level 1
File at path hxcs_build.txt not found

hxcs_build,txt file is generated to Temp directory by Haxe compiler.

So the file does exist?

What version of the hxcs haxelib library do you have?

Yes, the file exists in ProjectDir\Temp at the top level, along with C# source files in src folder. I have hxcs version 3.4.0 installed via haxelib, I think it is the latest version of the library.

Weird bug, what happens if you run haxelib run hxcs hxcs_build.txt --haxe-version 4000 --feature-level 1 manually in the ProjectDir\Temp folder?