waf / CSharpRepl

A command line C# REPL with syntax highlighting – explore the language, libraries and nuget packages interactively.
https://fuqua.io/CSharpRepl/
Mozilla Public License 2.0
2.95k stars 112 forks source link

Namespaces #367

Closed AnonymouZEE closed 5 months ago

AnonymouZEE commented 5 months ago

Version

0.6.7

What happened?

Hi ppl---

x.csx(12,1): error CS7021: Cannot declare namespace in script code

is there any way of implementing namespaces... even only to be considered at script execution.

it is really annoying not have this "facility" available...

waf commented 5 months ago

Hi, I agree that this would be nice to support, but it is unfortunately not possible given underlying constraints in dotnet/roslyn (see issue: https://github.com/dotnet/roslyn/issues/4478). If something does change in the underlying platform, I'd be happy to revisit this.