Closed Bukran closed 2 years ago
Not sure I follow. In this example you can see that C# code does not have static main: Are we talking about different things?
I was trying to check the syntax of the scripts in this sample https://github.com/oleg-shilo/cs-script.core/issues/24 It's like the extension was trying to find a .csproj
Ah, I see. Your are not checking the script (your code is not an executable code) but an effectively class library code.
Well it's not the intended use case but it is a useful one anyway. I am adding to the backlog as an enhancement. Will be available with the next release.
In a mean time you can check the syntax from the terminal window with the following command:
css -cd -check script.cs
Thank you, that's great news.
The latest release (v2.0.1) has an additional setting cs-script.extra_args
which allows passing CS-Script engine arguments (not script arguments):
Please note that there is no good reliable solution for your problem.
You can add the -cd
arg and then all your scripts will be checked for being able to be compiled into dll. Great but then your executable scripts will not be able to run :(
Meaning that this new setting is something that you can use but I cannot say that it is particularly convenient
Thanks for the follow-up
Hi, Oleg.
I work with CS-Script in a hosted environment. I find it very usefult to check the scripts syntax beforehand. Otherwise, an exception will be thrown in time of execution.
But VSCode extension always shows 2 errors: the program does not contain any 'Main' static method as entrypoint (translated from spanish). Is there any means to 'inform' the extension: this is not a program, but a single script?