gpt4 book ai didi

asp.net-mvc - ASP.Net 5 project.json脚本命令的完整列表? (Visual Studio 2015)

转载 作者:行者123 更新时间:2023-12-03 14:22:04 25 4
gpt4 key购买 nike

我查看了ASP.Net 5团队wiki上的project.json条目,以确定哪些脚本命令可用,并且当前列出了以下内容:

{
"scripts": {
"prebuild": "echo before building",
"postbuild": "echo after building",
"prepack": "echo before packing",
"postpack": "echo after packing",
"prerestore": "echo before restoring packages",
"postrestore": "echo after restoring packages"
}
}


这些简单明了,易于理解。但是,在Visual Studio中,似乎仅触发了还原前和还原后事件。生成前和生成后没有。

默认(测试版6)Visual Studio 2015模板添加了以下脚本命令,该命令不在官方列表中:

  "scripts": {
"prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ]
}


此外,似乎还有其他未记录的命令,我从同事创建的示例项目中继承了这些命令:

  "scripts": {
"first-run": "npm install -g gulp bower && npm run update",
"prepare": [ "npm install && npm prune && bower install && bower prune && gulp default" ],
"prepublish": [ "npm install", "bower install", "gulp default" ],
"update": "npm install && npm prune && bower install && bower prune"
}


这些似乎有效(它们执行),但是我和我的同事找不到文档来解释:


如果有效,则不建议使用。
如果它们特定于Visual Studio(我相信预发布仅适用于Visual Studio)
确切地说,它们是何时执行的,以及它们如何被Visual Studio识别(名称似乎很明显,但我希望可以确定)。


为了进一步混淆问题,Visual Studio 2015智能感知将显示其他不在正式列表中的命令:

enter image description here

是否有有效的project.json脚本命令及其用法等的列表,尤其是对于Visual Studio 2015而言?

最佳答案

更新24/05/2016:

Microsoft正在逐步淘汰project.json,然后返回csproj。


.NET作为平台的主要原则之一是,我们希望我们的开发人员能够在所有.NET应用程序模型(WinForms,WPF,UWP,ASP.NET,iOS,Android等)之间共享代码。这带来了一系列问题,而project.json非常适合构建Web应用程序和类库,但不允许统一其他应用程序模型。

...

在查看了我们的选择之后,很明显将.NET Core项目移动到.csproj / MSBuild会更容易,因此所有.NET项目都使用相同的工具和构建系统。


Quote taken from here



2016年3月30日的update on the Nuget blog指出


Visual Studio编辑器和NuGet扩展支持DNX的最新project.json模式。


project.json schema列出了以下可用的脚本命令:

        "scripts": {
"type": "object",
"description": "Scripts to execute during the various stages.",
"properties": {
"precompile": { "$ref": "#/definitions/script" },
"postcompile": { "$ref": "#/definitions/script" },
"prepack": { "$ref": "#/definitions/script" },
"postpack": { "$ref": "#/definitions/script" },
"prepublish": { "$ref": "#/definitions/script" },
"postpublish": { "$ref": "#/definitions/script" },
"prerestore": { "$ref": "#/definitions/script" },
"postrestore": { "$ref": "#/definitions/script" },
"prepare": { "$ref": "#/definitions/script" }
}
},

关于asp.net-mvc - ASP.Net 5 project.json脚本命令的完整列表? (Visual Studio 2015),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32188215/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com