Apologies, I left C# years ago when there were only 5,000 things to keep in your head at any one time.

I find it odd you feel that way.

I find C# to be remarkably better than javascript, for example, of having a 'right' way to do something.

Even when there are multiple ways the community tends to coalesce around one way.

C# always supported preprocessor directive.

Yes, but I would have thought attributes were the canonical "think you might want to reflect over" rather than this imperative solution. But you're all happy with it and it's not my circus, so enjoy.

This cannot be something you reflect over, because they allow to encode build arguments. They need to be parsed before it's compiled, which is exactly what preprocessors directive allows.

Java's annotations (which are mostly equivalent to C#'s attributes) can be consumed at compile time using annotation processors. If C# had this feature for attributes, could attributes have been used here?

C# have this feature, it's called roslyn code generator.

I believe your java annotations cannot change the build parameters of the package being currently compiled, which is why you wouldnt be able to do that in java.

btw, anything that is present in the AST could be used for that, but I think the preprocessor directive is the most sensible choice.

Fair enough. Presumably I can query a script first somehow to see what the dependency tree is going to look like?

Well for regular dotnet project there is `dotnet list` that allow that, I don't know how it will look c# script file, probably the same.

From what I've read of this preview `dotnet list` works as expected. Under the hood it supposedly builds a mini-project file so that most of the `dotnet` cli works as expected. It also provides an "eject button" to build the csproj from the script file `dotnet project convert`.

Yup; from v1

[deleted]