how to add a new c# file to a project using dotnet-cli

Richard77 picture Richard77 · Mar 3, 2018 · Viewed 19.8k times · Source

I'm learning how to use dotnet-cli with VSCode. I've seen many commands on how to create solution, projects, add reference to projects... but I don't see anywhere in the documentation how to add a file. If remember, in RubyOnRails it was possible to add file from the command line.

Thanks for helping

Answer

Andrey Zhilyakov picture Andrey Zhilyakov · Mar 28, 2019

Not that I know of (I was also researching that topic) but I found helpful extension for VS code called C# Extensions by jchannon, which helps you create classes and interfaces with correct namespace by right-clicking the folder in VS code explorer and selecting to create C# class or C# interface.