LoginSignup
6
9

More than 5 years have passed since last update.

ASP.NET Core MVC アプリケーション作成手順

Last updated at Posted at 2016-05-01

今後、.NET Coreを利用したアプリケーションを作成することになりそうなので、作成のための手順を備忘録的に書いておきます。

前提条件

確認済み環境

・Windows 10 64bit

ツール

インストールされていること
- Node.js(Yoemanなどを実行するのに必要)
- Yoeman(プロジェクト作成に使う)
- bower(クライアントサイドのライブラリ管理)
- Gulp(タスクツール)
- Grunt(タスクツール)
- Visual Studio Codeなどのテキストエディタ

作成手順

1. .NET Coreのインストール

ASP.NET vNext Homeを参考にして、.NET Coreをインストールする
コマンドライン
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch='dev';$wc=New-Object System.Net.WebClient;$wc.Proxy=[System.Net.WebRequest]::DefaultWebProxy;$wc.Proxy.Credentials=[System.Net.CredentialCache]::DefaultNetworkCredentials;Invoke-Expression ($wc.DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}"

2. Yoemanのジェネレータをインストール

コマンドライン or Powershellからコマンドを実行
npm install -g generator-aspnet

3. ASP.NET Core MVCのプロジェクトを作成

プロジェクトを作成するディレクトリに移動
yo aspnet
プロジェクト名:適当なプロジェクト名
プロジェクトの種類:Web Application もしくは Web Application Basic [without Membership and Authorization]
Web Application Basic [without Membership and Authorization]を選択するとEntity Framework Core 1.0やASP.NET Identityがインストールされない

4. プロジェクトの実行

cd プロジェクト名
プロジェクトの復元(nugetパッケージの復元)
dnu restore
プロジェクトのコンパイル
dnu build
プロジェクトの実行
dnx web
Kestrelが実行され、5000ポートで待ち受けが行われる

6
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
9