VisualStudioの使用を開始する方法に関する初心者向けガイド

Microsoft Visual Studioの最初のバージョンは1998年にリリースされました。現在、最新の製品はVisual Studio 2017という名前で、多数の機能が含まれています。1998年にリリースされて以来、長い道のりを歩んできました。では、初心者がVSを使い始める方法について簡単に説明します。したがって、まず最初に、オンラインインストーラーを使用するか、最初にオフラインにするかを決定する必要があります。これは奇妙に複雑です。パッケージにはAndroidEmulatorやiOSSDKなどのサードパーティコンポーネントが含まれているため、MicrosoftはVS 2015まで以前のようにオフラインISOイメージを直接ホストできません。したがって、ソフトウェアをダウンロードする方法は2つあります。オフラインまたはオンラインのインストーラーが必要な場合。両方を1つずつ見ていきましょう。

VisualStudioのインストール方法

オフライン方式

適切なエディションの入手

まず、実際にダウンロードするMicrosoft VisualStudioのエディションを確認する必要があります。次に、その特定のエディションに適したWebインストーラーを入手する必要があります。次のリンクは、VS2017の目的のエディションのWebインストーラー用です。

  • ここからVisualStudio Community2017を入手してください。
  • ここからVisualStudio Professional2017を見つけます。
  • ここからVisualStudio Enterprise2017をダウンロードします。

オフラインキャッシュ用のすべてのファイルを取得する

この領域は少し注意が必要です。ここでは、最初にダウンロードする必要のある開発コンポーネントを判断する必要があります。.NET Webおよびデスクトップ開発パッケージ用に個別のコマンド(yes!コマンド)があります。.NET OfficeDevelopment用とそれに応じたその他の別のもの。

各コンポーネントについて始めましょう。私はこれを言っています。すべてのコンポーネントを入手する必要はありません。あなたにとって重要なものだけを入手してください。

まず、管理者権限でコマンドプロンプトを開きます。

次に、ダウンロードしたインストーラーが保存されている場所に移動します。

次に、必要に応じて次のコマンドライン命令の実行を開始します。

  • .NETWebおよび.NETDesktopの開発では、次のコマンドを実行します。
vs_community.exe --layout c:\ vs2017layout --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NetWeb --add Component.GitHub.VisualStudio --includeOptional --lang en-US
  • .NETデスクトップおよびオフィス開発の場合は、次を実行します。
vs_community.exe --layout c:\ vs2017layout --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.Office --includeOptional --lang en-US
  • C ++デスクトップ開発の場合、これを実行します。
vs_community.exe --layout c:\ vs2017layout --add Microsoft.VisualStudio.Workload.NativeDesktop --includeRecommended --lang en-US
  • コンポーネントの完全な機能パックオフラインコレクションについては、次を実行します。
vs_community.exe --layout c:\ vs2017layout --lang en-US 

ソフトウェアの言語として英語を使用したくない場合は、上記のコマンドのen-USを目的の言語に交換してください。

ダウンロードしたキャッシュからのVisualStudioのインストール

ダウンロードしたファイルのみをインストールするようにしたい場合は、このコマンドライン命令を実行して確認できます。

vs_community.exe --layout c:\ vs2017layout --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NetWeb --add Component.GitHub.VisualStudio --includeOptional --lang en-US

最後に、ダウンロードしたファイルからVSをインストールするには、このコマンドライン命令を実行します。

c:\ vs2017layout \ vs_community.exe --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NetWeb --add Component.GitHub.VisualStudio --includeOptional

オンラインインストール

オンラインインストーラーを使用してVisualStudioをダウンロードするには、目的のエディションに応じて次のファイルのいずれかをダウンロードするだけです。

  • ここからVisualStudio Community2017を入手してください。
  • ここからVisualStudio Professional2017を見つけます。
  • ここからVisualStudio Enterprise2017をダウンロードします。

ダウンロードしたファイルを実行するだけです。その後、次のような画面が表示されます。

次に、[続行]をクリックすると、このページが表示されます。

get started with Visual Studio

On this page, you will have to select the components that you need to download. Select them and click on Install.

After this, you will see VS downloading and applying components that you selected as shown in the screenshot below.

After this, you just have to plug in your device in case you are using a laptop or a Surface device. This is so because you don’t want your computer to go to sleep while this installation is taking place. And when your installer is done with applying all the required components, you will see this screen.

Eureka! You have Visual Studio 2017 installed on your machine. You can find it in the Start Menu as shown in the screen snippet below or else find it as a shortcut on your desktop.

Now, when you run Visual Studio, it will ask you to sign in with your Microsoft Account. If you are using Professional or Enterprise edition, I would recommend you to sign in with the email that you used to buy the subscription. After you are signed in, you will see this Get Started page.

First, we will see how things work inside VS 2017. Navigate to File> New > Project. A small window will pop up now which will resemble this as shown in the screen snippet below.

Just for starters and a simple program example, Choose the Visual C# library in the left panel and Console App in the list of components. And now, hit OK.

This will create a new project based on a C# Console App and open it.

Now, you can start writing your code in between those curly braces as marked in the snippet above.

Write this code in that code block. (A code block is a region between two curly brackets of a particular function. Here, the Main function.)

Console.WriteLine("Welcome to TheWindowsClub.com!"); Console.ReadLine();

Simply now your code should be looking something like this:

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace HelloWorld { class Program { static void Main(string[] args) { Console.WriteLine("Welcome to TheWindowsClub.com!"); Console.ReadLine(); } } }

Hit F5 on your keyboard to run the program. Now, a console window will pop up showing you the output as

Welcome to TheWindowsClub.com!

You can see it here.

Now due to the code is written as Console.ReadLine(); you will have to press any key on the keyboard to return to your code.

This was a very basic program written in C#, in case you would like to discover more, I would recommend you to check our Tutorials about Languages supported in .NET Framework and .NET Core. And in case you wish to learn from official videos, Microsoft Virtual Academy (MVA) will be able to help you. MVA will even help you certified by Microsoft directly.

TIP: To learn C# from MVA, I would highly recommend you to refer Bob Tabor’s tutorials which can be found here.

If you have any further queries, feel free to comment them down, and I will try my best to address them as soon as possible.