[.NET CLI] dotnet 1.0.0-beta-001598 與 1.0.0-preview3-003246 用 dotnet new 建立的專案差異

  • 306
  • 0

繼上一篇 [.NET CLI] 將 dotnet 1.0.0-beta-001598 更新至 1.0.0-preview3-003246 ,

我在想這邊紀錄一下這兩個版本用 dotnet new 預設建立的專案內容差異,

1.0.0-beta-001598 一共有三個文件:

  1. NuGet.Config
  2. Program.cs
  3. project.json

 

NuGet.Config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <!--To inherit the global NuGet package sources remove the <clear/> line below -->
    <clear />
    <add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
    <add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
  </packageSources>
</configuration>

Program.cs

using System;

namespace ConsoleApplication
{
    public class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
}

project.json

{
    "version": "1.0.0-*",
    "compilationOptions": {
        "emitEntryPoint": true
    },

    "dependencies": {
        "NETStandard.Library": "1.0.0-rc2-23811"
    },

    "frameworks": {
        "dnxcore50": { }
    }
}

1.0.0-preview3-003246 共有兩個文件

  1. Program.cs
  2. project.json

Program.cs

using System;

class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine("Hello World!");
    }
}

project.json

{
  "version": "1.0.0-*",
  "buildOptions": {
    "debugType": "portable",
    "emitEntryPoint": true
  },
  "dependencies": {},
  "frameworks": {
    "netcoreapp1.0": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "type": "platform",
          "version": "1.0.0"
        }
      },
      "imports": "dnxcore50"
    }
  }
}

 

結論:我覺得 project.json 差蠻多的!! 

詳細要瞭解 project.json 可參考這篇官方文章 讓我們 Core 在一起:ASP.NET Core & .NET Core