Help us understand the problem. What is going on with this article?

.NET Core に関するメモ (2017年10月)

More than 1 year has passed since last update.

まとまってるのがあまりなかったので.....
.NET Core 使う際の自分用メモ
現在の最新は.Net Core 2.0

インストール

  1. Windwos
    ダウンロードしてインストールするだけ
    https://www.microsoft.com/net/core#windowscmd
  2. Ubuntu
    パッケージの追加
    curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
    sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
    インストールはUbuntuのバージョンごとに微妙に違う
    Ubuntu 17.04
    sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-zesty-prod zesty main" > /etc/apt/sources.list.d/dotnetdev.list'
    Ubuntu 16.04
    sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
    Ubuntu 14.04
    sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
    あとはいつも通り
    sudo apt-get update
    sudo apt-get install dotnet-sdk-2.0.0

新規プロジェクト/ファイルの作成

  1. Console Application
    dotnet new console -o hogehoge
  2. Class library
    dotnet new classlib -o hogehoge
  3. Unit Test Project
    dotnet new mstest -o hogehoge
  4. xUnit Test Project
    dotnet new xunit -o hogehoge
  5. ASP.NET Core Empty
    dotnet new web -o hogehoge
  6. ASP.NET Core Web App (Model-View-Controller)
    dotnet new mvc -o hogehoge
  7. ASP.NET Core Web App
    dotnet new razor -o hogehoge
  8. ASP.NET Core with Angular
    dotnet new angular -o hogehoge
  9. ASP.NET Core with React.js
    dotnet new react -o hogehoge
  10. ASP.NET Core with React.js and Redux
    dotnet new reactredux -o hogehoge
  11. ASP.NET Core Web API
    dotnet new webapi -o hogehoge
  12. global.json file
    dotnet new globaljson -o hogehoge
  13. Nuget Config
    dotnet new nugetconfig -o hogehoge
  14. Web Config
    dotnet new webconfig -o hogehoge
  15. Solution File
    dotnet new sln -o hogehoge
  16. Razor Page
    dotnet new page -o hogehoge
  17. MVC ViewImports
    dotnet new viewimports -o hogehoge
  18. MVC ViewStart
    dotnet new viewstart -o hogehoge

パッケージの追加(Nugetなど)

dotnet add package hogehoge

依存ファイルの復元(反映?)

Configファイル書き直した場合などに
dotnet restore

起動

dotnet run

まとめ

.NetCore に限らないけど困ったら-hすればなんとかなったりする。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした