asp.Net   发布时间:2022-04-04  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了asp.net-mvc – ASP.Net 5 project.json脚本命令的完整列表? (Visual Studio 2015)大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我查看了project.json的ASP.Net 5团队wiki条目,以确定哪些脚本命令可用,目前列出了以下内容:
{
  "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中,只有预恢复和后恢复事件似乎实际上已经开始了。预制和后期建筑没有。

默认(beta 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","gulp default" ],"update": "npm install && npm prune && bower install && bower prune"
  }

这些似乎工作(他们执行),但我的同事和我无法找到文档来解释:

>如果它们有效或已被弃用。
>如果它们是特定于Visual studio(我相信预发布仅适用于Visual studio)
>完全执行它们,以及Visual studio如何识别它们(名称看起来很明显,但我更希望确定)。

为了进一步混淆事实,Visual studio 2015智能感知显示不在官方列表中的其他命令:

有没有一个有效的project.json脚本命令列表,它们的用法等,特别是对于Visual studio 2015?

解决方法

更新24/05/2016:

微软正在淘汰project.json并返回csproj。

Quote taken from here

2016年3月30日update on the Nuget blog发布

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)全部内容,希望文章能够帮你解决asp.net-mvc – ASP.Net 5 project.json脚本命令的完整列表? (Visual Studio 2015)所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。