ASP.NET Core
專案系統 > v1.0 時期 > project.json

ASP.NET Core v1.0 時期由 project.json 主掌專案的執行期的組態設定，包含專案的套件參考 (Package References)、專案的基本設定、啟動指令、包含或排除指定目錄、以及建造時的相關事件指令等。
下列JSON為 project.json 的範例：
{
  "userSecretsId": "...",

  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.0-rc2-3002538",
      "type": "platform"
    },
    "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0-rc2-20828",
    "Microsoft.AspNetCore.Diagnostics": "1.0.0-rc2-20828",
    "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0-rc2-20828",
    "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0-rc2-20828",
    "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-20828",
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview1-20828",
      "type": "build"
    },
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-20828",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-20828",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-20828",
    "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-rc2-20828",
    "Microsoft.EntityFrameworkCore.Tools": {
      "version": "1.0.0-preview1-20828",
      "type": "build"
    },
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0-rc2-20828",
    "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-20828",
    "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc2-20828",
    "Microsoft.Extensions.Logging": "1.0.0-rc2-20828",
    "Microsoft.Extensions.Logging.Console": "1.0.0-rc2-20828",
    "Microsoft.Extensions.Logging.Debug": "1.0.0-rc2-20828",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc2-20828",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
      "version": "1.0.0-preview1-20828",
      "type": "build"
    },
    "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
      "version": "1.0.0-preview1-20828",
      "type": "build"
    }
  },

  "tools": {
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview1-20828",
      "imports": "portable-net45+win8+dnxcore50"
    },
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": {
      "version": "1.0.0-preview1-20828",
      "imports": "portable-net45+win8+dnxcore50"
    },
    "Microsoft.EntityFrameworkCore.Tools": {
      "version": "1.0.0-preview1-20828",
      "imports": [
        "portable-net45+win8+dnxcore50",
        "portable-net45+win8"
      ]
    },
    "Microsoft.Extensions.SecretManager.Tools": {
      "version": "1.0.0-preview1-20828",
      "imports": "portable-net45+win8+dnxcore50"
    },
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
      "version": "1.0.0-preview1-20828",
      "imports": [
        "portable-net45+win8+dnxcore50",
        "portable-net45+win8"
      ]
    }
  },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "dotnet5.6",
        "dnxcore50",
        "portable-net45+win8"
      ]
    }
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },

  "runtimeOptions": {
    "gcServer": true
  },

  "publishOptions": {
    "include": [
      "wwwroot",
      "Views",
      "appsettings.json",
      "web.config"
    ]
  },

  "scripts": {
    "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ],
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }
}