「[[マイクロソフト系技術情報 Wiki>http://techinfoofmicrosofttech.osscons.jp/]]」は、「[[Open棟梁Project>https://github.com/OpenTouryoProject/]]」,「[[OSSコンソーシアム .NET開発基盤部会>https://www.osscons.jp/dotNetDevelopmentInfrastructure/]]」によって運営されています。

-戻る
--[[OmniSharp]]
--[[Visual Studio Code]]
--[[.NET Coreの開発]]
--[[ASP.NET Coreの開発]]

* 目次 [#dad67794]
#contents

*概要 [#c81c5188]
-[[OmniSharp]]を使用した[[Visual Studio Code]]のC#拡張機能
-コード補完などの他、デバッグに関する機能などがある。

*手順 [#pc932ac9]

**Windows上での手順 [#zc9826db]

***インストール [#m60d4c3a]
以下をインストール
-.NET Core SDK
-Visual Studio Code
-CSharp for Visual Studio Code

***プロジェクトの作成 [#r622e796]
おなじみの、メニュー → [新規作成] → [プロジェクト]は無いので、~
[ターミナル] → [新しいターミナル]から、以下のdotnet newコマンドを入力し、~
任意のプロジェクト・テンプレートを作成(ここではMVCを選択)。

 > dotnet new mvc -n MyMVCApp -o MyMVCApp

***プロジェクトを開く [#pcfb61bc]
-自動的にプロジェクトが変更されないので、~
メニュー → [ファイル] → [フォルダーを開く]から、~
上記で生成されたプロジェクトのルートを開く。

-これで、コーディングなどが可能。

***デバッグ実行をする。 [#n9b086e5]
-デバッグ(Ctrl + Shift + D)を押下
-表示された歯車マークを押下
-表示されたドロップダウンから「.NET Core」を選択する。

#ref(Win-1.png,left,nowrap,Win-1)

-するとlaunch.jsonが追加されるので、おなじみの[F5]実行を行う。

#ref(Win-2.png,left,nowrap,Win-2,70%)

-ブレークポイントを設定して、停止、ステップ実行できるか確認する。

※ ちなみに、netstat -a -bで確認すると、ホストはdotnet.exeらしい。

***Open棟梁をデバッグ実行してみる。 [#r1c2d909]
-以下を前述の手順に従い準備する。~
...\root\programs\CS\Samples4NetCore\Backend\MVC_Sample

-あー、普通に動いた。
#ref(Win-3.png,left,nowrap,Win-3,70%)

**Linux上での手順 [#b9428737]

***インストール [#d44fa86a]

***プロジェクトの作成 [#xcf72476]

***プロジェクトを開く [#l99002b9]

***デバッグ実行をする。 [#i386ee6c]

*参考 [#l7b8c562]
-Visual Studio Code で ASP.NET Coreをデバッグ実行する(Win/Ubuntu/Mac) - きよくらの備忘録~
http://kiyokura.hateblo.jp/entry/2016/11/25/010742

-C# 書くのも VisualStudioCode でいいかも~
http://var.blog.jp/archives/74632988.html

-Getting Started With ASP.NET Core MVC Apps Using VS Code~
https://www.c-sharpcorner.com/article/getting-started-with-asp-net-core-mvc-apps-using-vs-code/

**Qiita [#hf7ad294]
-dotnet コマンドでクラスライブラリとテストプロジェクトを作る~
https://qiita.com/kik4/items/d1b0d86e0048ffc00b7d

-Mac
--Visual Studio Code ではじめての C# アプリケーションを作る~
https://qiita.com/nskydiving/items/4127c96e9588016566fe
--Visual Studio Code ではじめての ASP.NET Core アプリケーションを作る~
https://qiita.com/nskydiving/items/d144c864b30272d68236

**Microsoft Docs [#ie8e6d71]
-dotnet new コマンド - .NET Core CLI~
https://docs.microsoft.com/ja-jp/dotnet/core/tools/dotnet-new

-~を作成する

--ASP.NET Core と Visual Studio Code で Razor ページ Web アプリ~
https://docs.microsoft.com/ja-jp/aspnet/core/tutorials/razor-pages-vsc/

--Visual Studio Code を使用して ASP.NET Core MVC アプリ~
https://docs.microsoft.com/ja-jp/aspnet/core/tutorials/first-mvc-app-xplat/

--ASP.NET Core と VS Code で Web API~
https://docs.microsoft.com/ja-jp/aspnet/core/tutorials/web-api-vsc

-C# および Visual Studio Code の使用を開始する - .NET Core~
https://docs.microsoft.com/ja-jp/dotnet/core/tutorials/with-visual-studio-code

**visualstudio.com [#f57257b9]
-C# - Visual Studio Marketplace~
https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp
-.NET Core and Visual Studio Code~
https://code.visualstudio.com/docs/other/dotnet
-C# programming with Visual Studio Code~
https://code.visualstudio.com/docs/languages/csharp

----
Tags: [[:.NET開発]], [[:.NET Core]]

トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS