Allow -main argument to override TLS entry point #9544
-
There is interest for BenchmarkDotNet to support the new Currently, BenchmarkDotNet generates a separate project with a generated entry point. But it won't work with The best way to do it is using Roslyn Source Generators. However, the problem is we can't generate an entry point if top-level statements are used, because the compiler does not allow -main argument. TLS are much more likely to be used in the new dotnet feature. So what we need is for the already existing -main compiler argument to simply let us use it to override TLS. I don't know what was the motivation to block it when TLS was introduced. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Allowing I was also thinking about a compiler-only solution via a feature flag like |
Beta Was this translation helpful? Give feedback.
-
Implemented in dotnet/roslyn#79577. |
Beta Was this translation helpful? Give feedback.
Implemented in dotnet/roslyn#79577.