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

前端之家收集整理的这篇文章主要介绍了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。

One of the key tenets of .NET as a platform is we want our developers to be able to share code across all of the .NET application models (WinForms,WPF,UWP,ASP.NET,iOS,Android,etc). This presented a series of problems,while project.json was great for building web applications and class libraries it did not allow unification of the other app models.

After looking at our choices,it was apparent that it would be easier to move .NET Core projects to .csproj/MSBuild so all .NET projects use the same tooling and build system.

Quote taken from here

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

The latest project.json schema for DNX is supported in the Visual Studio editor and by the NuGet extension

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" }
        }
    },
原文链接:https://www.f2er.com/aspnet/252245.html

猜你在找的asp.Net相关文章