getting started .net core
TRANSCRIPT
Getting Started .NET Core
2016/10/31 Fukuoka.NET
@tsubakimoto_s
About me
Yuta Matsumura
Alterbooth, Inc.
Microsoft MVP(Visual Studio and Development Technologies)
C#, VB.NET, PHP, Frontend, Azure
Community
2
MLBお兄さん
yuta.matsumura.31
3
4
どっとねっとこあ?
.NET Core
• .NET Frameworkのオープンソース版
•クロスプラットフォーム (Mac, Linux)
•バージョン
• 1.0 ... 2016/06
• 1.1-preview ... 2016/10
5
テンプレート
6
•クラスライブラリ
•コンソールアプリケーション
•ASP.NET Core Webアプリケーション
7
Flexible
deployment
Cross-
platform
Command-
line toolsCompatible
Open sourceSupported
by Microsofthttps://docs.microsoft.com/ja-jp/dotnet/articles/core/index
Cross-platform
Windows (Client, Server)RHELFedoraDebianUbuntuLinux MintopenSUSECentOSOracle LinuxMac OS X
8https://github.com/dotnet/core/blob/master/roadmap.md#technology-roadmaps
Command-line tools
9
dotnetコマンド
コマンド名 機能
dotnet new プロジェクトの新規作成
dotnet restore NuGetパッケージの復元
dotnet run プロジェクトの実行
dotnet build プロジェクトのビルド
dotnet test 単体テストの実行
dotnet pack プロジェクトをNuGetパッケージに変換
dotnet publish プロジェクトの発行(=公開用ファイルの生成)
10
dotnetコマンド
コマンド名 機能
dotnet new プロジェクトの新規作成
dotnet restore NuGetパッケージの復元
dotnet run プロジェクトの実行
dotnet build プロジェクトのビルド
dotnet test 単体テストの実行
dotnet pack プロジェクトをNuGetパッケージに変換
dotnet publish プロジェクトの発行(=公開用ファイルの生成)
11
NuGet
•https://www.nuget.org/
• .NET向けのパッケージマネージャ
•ライブラリ
•フレームワーク
•テンプレート etc
12
他言語のパッケージマネージャ
PHP : Composer Node.js : npm
13
Compatible
14
.NET Standard Library
.NET Core
(1.0 → 2.0 ※)
http://www.publickey1.jp/blog/16/netnet_standard.html
15https://docs.com/inoue-akira/8113
16http://www.hanselman.com/blog/SharingAuthorizationCookiesBetweenASPNET4xAndASPNETCore10.aspx
Open Source
17
dotnet/standard
dotnet/corefx dotnet/coreclr
dotnet/roslyn
dotnet/cli dotnet/docs
Windowsで使う
•インストール
• Visual Studio 2015 Update3
• Visual Studio Community 2015
• .NET Core 1.0.1 Tooling Preview 2
18
19
DEMO
Windowsで.NET Coreアプリを作る
https://docs.microsoft.com/ja-jp/dotnet/articles/core/tutorials/using-on-windows
project.json
•プロジェクト情報
•メタデータ
•コンパイル情報
•依存関係
20
project.json
{
"version": "1.0.0-*",
"buildOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.1"
}
},
"frameworks": {
"netcoreapp1.0": {
"imports": "dnxcore50"
}
}
}
21
https://docs.microsoft.com/ja-jp/dotnet/articles/core/tools/project-json
プロジェクトのバージョン番号⇒NuGetパッケージのバージョン番号
ビルド情報
依存関係の定義
フレームワーク情報“netcoreapp1.0” = .net coreアプリ
https://blogs.msdn.microsoft.com/cesardelatorre/2016/06/28/running-net-core-apps-on-multiple-frameworks-and-what-the-target-framework-monikers
Thank you!!