Add item to fsproj through dotnet CLI

Viewed 725

I am using the dotnet CLI (v1.0.4) to create and manage projects. I have found the documentation for and have successfully created projects using the CLI with commands such as the following:

dotnet new console -lang F# -o src/myConsoleApp

I have also figured out how to add references to other projects, DLLs, and Nuget packages.

The one thing that I can't figure out how to do is add a new compile item to the fsproj file through a CLI command. Does such a command exist? I can manually edit the fsproj file and add a new <Compile Include="..." />, but that seems too easy to make typos and other errors. I have been using Visual Studio for many years, so perhaps I am under the wrong impression that there should be another way than to manually edit the project file to add a file to a project?

0 Answers
Related