Comment

Comment by Wolfspirit

I have to agree with others that it's strange this has not been in line with .net interactive and the usage of "#r" there. I think "#r" should at least be an option.

You say that importing other files is not how c# works, but I think that's not entirely true. If you now treat a file as a project then an import is pretty much a project reference just to a .cs file instead of a .csproj file.

So I'd love to see something like that working: #:reference ./Tools.cs

Which should be the same as a ProjectReference in csproj or for a "real" project something like this: #:reference ./Tools/Tools.csproj

That would also enable things like this in a csproj file: <ProjectReference Include="..\Tools\Helpers.cs" />

parent Wolfspirit 1 year ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton