简体   繁体   English

在命令行上生成解决方案文件(从头开始创建新解决方案)?

[英]generate solution file on command line (create new solution from scratch)?

Is there a command line tool (I'm in cygwin specifically) which can generate template solution files for me? 是否有可以为我生成模板解决方案文件的命令行工具(特别是我在cygwin中)? When I use the Sharpdevlop GUI and say I'm doing a new project, I am prompted with choices that I can choose from, and then SharpDevelop automagically makes .sln, .csproj, .cs, etc files for me. 当我使用Sharpdevlop GUI并说我正在做一个新项目时,系统会提示我可以选择的选项,然后SharpDevelop自动为我制作.sln,.csproj,.cs等文件。 If all that's happening is that templates are being copied over and a few variable fields filled in (like project name), then it's just as possible to do this on the cli. 如果正在发生的事情是正在复制模板并填写了一些可变字段(例如项目名称),那么就可以在cli上做到这一点。

In my mind it would look like this: 在我看来,它看起来像这样:

$ #remember: I'm in Cygwin if that matters

$ ls
./ ../

$ sharpdevelop-init "Windows Application" Test  #or mono-init or something...

$ ls -R
.:
Test/  Test.sln

./Test:
MainForm.Designer.cs  Program.cs   Test.csproj  obj/
MainForm.cs           Properties/  bin/

..... etc ....

Is there such a command line tool? 有这样的命令行工具吗? Mono obviously does exactly what I want, but I want to know the command line interface to do it. 很明显,Mono完全可以实现我想要的功能,但是我想知道执行此操作的命令行界面。

Unfortunately there is no such command line application that does this as far as I am aware. 不幸的是,据我所知,没有这样的命令行应用程序可以执行此操作。

The closest thing to such an application in my opinion is using PowerShell and NuGet to automate SharpDevelop from the command line allowing you to install NuGet packages. 我认为,与此类应用程序最接近的是使用PowerShell和NuGet从命令行自动执行SharpDevelop,从而允许您安装NuGet软件包。 A NuGet package could contain your file templates. NuGet软件包可能包含您的文件模板。 This does not match what you are trying to do since the solution and project files need to have already been created. 这与您要尝试执行的操作不匹配,因为必须已经创建了解决方案和项目文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM