diff --git a/.openpublishing.redirection.json b/.openpublishing.redirection.json index 342c27e15a2c8..55705de6b613c 100644 --- a/.openpublishing.redirection.json +++ b/.openpublishing.redirection.json @@ -21,6 +21,11 @@ "source_path": "docs/csharp/features.md", "redirect_url": "/dotnet/articles/csharp/concepts" }, + { + "source_path": "docs/csharp/getting-started/with-visual-studio-2017.md", + "redirect_url": "/dotnet/articles/getting-started/with-visual-studio", + "redirect_document_id": true + }, { "source_path": "docs/csharp/getting-started/library-with-visual-studio_2017.md", "redirect_url": "/dotnet/articles/csharp/getting-started/library-with-visual-studio-2017" diff --git a/docs/core/getting-started.md b/docs/core/getting-started.md index cdbc63c47b00d..fc0faf4705a94 100644 --- a/docs/core/getting-started.md +++ b/docs/core/getting-started.md @@ -21,7 +21,7 @@ Install .NET Core on [Windows](https://www.microsoft.com/net/core#windows). You can get started developing .NET Core apps by following these step-by-step tutorials. -* [Building a C# Hello World Application with .NET Core in Visual Studio 2017](../csharp/getting-started/with-visual-studio-2017.md) - Learn to to build, debug, and publish a simple .NET Core console application using Visual Studio 2017. +* [Building a C# Hello World Application with .NET Core in Visual Studio 2017](../csharp/getting-started/with-visual-studio.md) - Learn to to build, debug, and publish a simple .NET Core console application using Visual Studio 2017. * [Building a class library with C# and .NET Core in Visual Studio 2017](../csharp/getting-started/library-with-visual-studio-2017.md) - Learn how to build a class library written in C# using Visual Studio 2017 * [Get started with Visual Studio Code using C# and .NET Core on Windows](https://channel9.msdn.com/Blogs/dotnet/Get-started-with-VS-Code-using-CSharp-and-NET-Core) - This [Channel9](https://channel9.msdn.com) video shows you how to install and use [Visual Studio Code](https://www.visualstudio.com/products/code-vs), Microsoft's lightweight cross-platform code editor, to create your first console application in .NET Core. * [Getting started with .NET Core using the command-line](tutorials/using-with-xplat-cli.md) - Use any code editor with the [.NET Core cross-platform command-line interface (CLI)](tools/index.md). diff --git a/docs/core/media/windows-prerequisites/vs_workloads.jpg b/docs/core/media/windows-prerequisites/vs_workloads.jpg new file mode 100644 index 0000000000000..4f910f2a2ff3e Binary files /dev/null and b/docs/core/media/windows-prerequisites/vs_workloads.jpg differ diff --git a/docs/core/tutorials/index.md b/docs/core/tutorials/index.md index 6ba2c429eb2e8..a4122670fc844 100644 --- a/docs/core/tutorials/index.md +++ b/docs/core/tutorials/index.md @@ -17,7 +17,7 @@ The following tutorials are available for learning about .NET Core. ## Building applications with Visual Studio 2017 -- [Building a C# Hello World application](../../csharp/getting-started/with-visual-studio-2017.md) +- [Building a C# Hello World application](../../csharp/getting-started/with-visual-studio.md) - [Debugging your C# Hello World application](../../csharp/getting-started/debugging-with-visual-studio-2017.md) - [Publishing your C# Hello World application](../../csharp/getting-started/publishing-with-visual-studio-2017.md) - [Building a C# class library](../../csharp/getting-started/library-with-visual-studio-2017.md) diff --git a/docs/core/tutorials/netcore-hosting.md b/docs/core/tutorials/netcore-hosting.md index 09e933b47ecdb..8909243963b59 100644 --- a/docs/core/tutorials/netcore-hosting.md +++ b/docs/core/tutorials/netcore-hosting.md @@ -23,7 +23,7 @@ This article gives an overview of the steps necessary to start the .NET Core run Because hosts are native applications, this tutorial will cover constructing a C++ application to host .NET Core. You will need a C++ development environment (such as that provided by [Visual Studio](https://www.visualstudio.com/downloads/)). -You will also want a simple .NET Core application to test the host with, so you should install the [.NET Core SDK](https://www.microsoft.com/net/core) and [build a small .NET Core test app](https://github.com/dotnet/docs/blob/master/docs/csharp/getting-started/with-visual-studio.md) (such as a 'Hello World' app). The 'Hello World' app created by the new .NET Core console project template is sufficient. +You will also want a simple .NET Core application to test the host with, so you should install the [.NET Core SDK](https://www.microsoft.com/net/core) and [build a small .NET Core test app](../../csharp/getting-started/with-visual-studio.md) (such as a 'Hello World' app). The 'Hello World' app created by the new .NET Core console project template is sufficient. This tutorial and its [associated sample](https://github.com/dotnet/docs/tree/master/samples/core/hosting) build a Windows host, but please see the notes at the end of this article about hosting on Unix. diff --git a/docs/core/tutorials/using-on-windows.md b/docs/core/tutorials/using-on-windows.md index 861c883c9a15a..d60c48c77dbda 100644 --- a/docs/core/tutorials/using-on-windows.md +++ b/docs/core/tutorials/using-on-windows.md @@ -6,4 +6,4 @@ redirect_url: /dotnet/articles/csharp/getting-started/with-visual-studio-2017 ## Content retired! -For a getting started tutorial on .NET Core and Visual Studio 2017, see [(Building a C# Hello World application with .NET Core in Visual Studio 2017](../../csharp/getting-started/with-visual-studio-2017.md). \ No newline at end of file +For a getting started tutorial on .NET Core and Visual Studio 2017, see [(Building a C# Hello World application with .NET Core in Visual Studio 2017](../../csharp/getting-started/with-visual-studio.md). \ No newline at end of file diff --git a/docs/core/windows-prerequisites.md b/docs/core/windows-prerequisites.md index 0b60de2517028..88c480828d274 100644 --- a/docs/core/windows-prerequisites.md +++ b/docs/core/windows-prerequisites.md @@ -4,7 +4,7 @@ description: Learn what dependencies you need on your Windows machine to develop keywords: .NET Core, Windows, prerequisites, dependencies, Visual Studio author: mairaw ms.author: mairaw -ms.date: 01/05/2017 +ms.date: 03/07/2017 ms.topic: article ms.prod: .net-core ms.devlang: dotnet @@ -41,9 +41,18 @@ You can see the full set of [supported operating systems](https://github.com/dot You can use any editor of your choice to develop .NET Core applications using the .NET Core SDK. However, if you want to develop .NET Core applications on Windows in an integrated development environment, you can use [Visual Studio 2017](#visual-studio-2017). +> [!IMPORTANT] +> Even though, it's possible to use Visual Studio 2015 with a preview version of the .NET Core tooling, these projects will be *project.json*-based, which is now deprecated. Visual Studio 2017 uses project files based on MSBuild. For more information about the format changes, see [High-level overview of changes](./tools/cli-msbuild-architecture.md). + To use Visual Studio 2017 to develop .NET Core apps, you'll need to have the latest version of Visual Studio installed with the **.NET Core cross-platform development** toolset (in the **Other Toolsets** section) selected. +![Screenshot of Visual Studio 2017 installation with the ".NET Core cross-platform development" workload selected](./media/windows-prerequisites/vs_workloads.jpg) + +There are different editions of Visual Studio 2017. You can download [Visual Studio Community 2017](https://www.visualstudio.com/downloads/) for free to get started. To learn more about the Visual Studio installation process, see [Install Visual Studio 2017](https://docs.microsoft.com/en-us/visualstudio/install/install-visual-studio). -There are different editions of Visual Studio 2017. You can download [Visual Studio Community 2017](https://www.visualstudio.com/vs/visual-studio-2017/#downloadvs) for free to get started. To learn more about the Visual Studio installation process, see [Install Visual Studio 2017](https://docs.microsoft.com/en-us/visualstudio/install/install-visual-studio). ++To verify that you're running the latest version of Visual Studio 2017, do the following: + + + +* On the **Help** menu, choose **About Microsoft Visual Studio**. + +* In the **About Microsoft Visual Studio** dialog, the version number should be 15.0.26228.4 or higher. You can read more about the changes in Visual Studio 2017 in the [release notes](https://www.visualstudio.com/en-us/news/releasenotes/vs2017-relnotes). diff --git a/docs/csharp/getting-started/media/breakpoint.jpg b/docs/csharp/getting-started/media/breakpoint.jpg deleted file mode 100644 index cd961fc124ee8..0000000000000 Binary files a/docs/csharp/getting-started/media/breakpoint.jpg and /dev/null differ diff --git a/docs/csharp/getting-started/media/codewindow.jpg b/docs/csharp/getting-started/media/codewindow.jpg deleted file mode 100644 index 6b251c2e909fa..0000000000000 Binary files a/docs/csharp/getting-started/media/codewindow.jpg and /dev/null differ diff --git a/docs/csharp/getting-started/media/codewindow_2017.jpg b/docs/csharp/getting-started/media/codewindow_2017.jpg deleted file mode 100644 index 6cc49fba51497..0000000000000 Binary files a/docs/csharp/getting-started/media/codewindow_2017.jpg and /dev/null differ diff --git a/docs/csharp/getting-started/media/console.jpg b/docs/csharp/getting-started/media/console.jpg deleted file mode 100644 index a01d9431d12c6..0000000000000 Binary files a/docs/csharp/getting-started/media/console.jpg and /dev/null differ diff --git a/docs/csharp/getting-started/media/setbreakpoint.jpg b/docs/csharp/getting-started/media/setbreakpoint.jpg deleted file mode 100644 index 11dad5dfde4d9..0000000000000 Binary files a/docs/csharp/getting-started/media/setbreakpoint.jpg and /dev/null differ diff --git a/docs/csharp/getting-started/media/vs_devenv.jpg b/docs/csharp/getting-started/media/vs_devenv.jpg deleted file mode 100644 index 95dae6c3cc445..0000000000000 Binary files a/docs/csharp/getting-started/media/vs_devenv.jpg and /dev/null differ diff --git a/docs/csharp/getting-started/media/vs_devenv_2017.jpg b/docs/csharp/getting-started/media/vs_devenv_2017.jpg deleted file mode 100644 index 5ef6267bed38b..0000000000000 Binary files a/docs/csharp/getting-started/media/vs_devenv_2017.jpg and /dev/null differ diff --git a/docs/csharp/getting-started/media/vs_newproject.jpg b/docs/csharp/getting-started/media/vs_newproject.jpg deleted file mode 100644 index 74e167301eb0f..0000000000000 Binary files a/docs/csharp/getting-started/media/vs_newproject.jpg and /dev/null differ diff --git a/docs/csharp/getting-started/media/vs_newproject_2017.jpg b/docs/csharp/getting-started/media/vs_newproject_2017.jpg deleted file mode 100644 index fed3eb330b2c3..0000000000000 Binary files a/docs/csharp/getting-started/media/vs_newproject_2017.jpg and /dev/null differ diff --git a/docs/csharp/getting-started/media/with-visual-studio/codewindow.jpg b/docs/csharp/getting-started/media/with-visual-studio/codewindow.jpg new file mode 100644 index 0000000000000..f06b32c6be568 Binary files /dev/null and b/docs/csharp/getting-started/media/with-visual-studio/codewindow.jpg differ diff --git a/docs/csharp/getting-started/media/console_2017.jpg b/docs/csharp/getting-started/media/with-visual-studio/console.jpg similarity index 100% rename from docs/csharp/getting-started/media/console_2017.jpg rename to docs/csharp/getting-started/media/with-visual-studio/console.jpg diff --git a/docs/csharp/getting-started/media/simple_hello.jpg b/docs/csharp/getting-started/media/with-visual-studio/simple_hello.jpg similarity index 100% rename from docs/csharp/getting-started/media/simple_hello.jpg rename to docs/csharp/getting-started/media/with-visual-studio/simple_hello.jpg diff --git a/docs/csharp/getting-started/media/with-visual-studio/vs_devenv.jpg b/docs/csharp/getting-started/media/with-visual-studio/vs_devenv.jpg new file mode 100644 index 0000000000000..7f8735ea67c8e Binary files /dev/null and b/docs/csharp/getting-started/media/with-visual-studio/vs_devenv.jpg differ diff --git a/docs/csharp/getting-started/media/with-visual-studio/vs_newproject.jpg b/docs/csharp/getting-started/media/with-visual-studio/vs_newproject.jpg new file mode 100644 index 0000000000000..bcc17d01836c9 Binary files /dev/null and b/docs/csharp/getting-started/media/with-visual-studio/vs_newproject.jpg differ diff --git a/docs/csharp/getting-started/publishing-with-visual-studio-2017.md b/docs/csharp/getting-started/publishing-with-visual-studio-2017.md index 8ed1c15991583..00e457b95cead 100644 --- a/docs/csharp/getting-started/publishing-with-visual-studio-2017.md +++ b/docs/csharp/getting-started/publishing-with-visual-studio-2017.md @@ -48,4 +48,4 @@ To publish and run your application: The publishing process creates a framework-dependent deployment; the published application will run on any platform supported by .NET Core, as long as .NET Core is installed on the system. Users can run your application by issuing the `dotnet.exe HelloWorld.dll` command from a console window. -For more information on publishing and deploying .NET Core applications, see [.NET Core Application Deployment](../../core/deploying/index.md). +For more information on publishing and deploying .NET Core applications, see [.NET Core Application Deployment](../../core/deploying/index.md). \ No newline at end of file diff --git a/docs/csharp/getting-started/toc.md b/docs/csharp/getting-started/toc.md index 96bbc820b919e..a75a71a8a7705 100644 --- a/docs/csharp/getting-started/toc.md +++ b/docs/csharp/getting-started/toc.md @@ -5,9 +5,6 @@ ## [Building a class library with C# and .NET Core in Visual Studio 2017](library-with-visual-studio-2017.md) ### [Testing a class library with .NET Core in Visual Studio 2017](testing-library-with-visual-studio.md) ### [Consuming a class library with .NET Core in Visual Studio 2017](consuming-library-with-visual-studio-2017.md) -## [Getting started with Visual Studio 2015](with-visual-studio.md) -### [Debugging your Hello World application with Visual Studio 2015](debugging-with-visual-studio.md) -### [Publishing your Hello World application with Visual Studio 2015](publishing-with-visual-studio.md) ## [Getting started with Visual Studio Code](with-visual-studio-code.md) ## [🔧 Getting started with cross-platform tools](with-cross-platform-tools.md) -## [🔧 Getting started with C# Interactive](with-csharp-interactive.md) +## [🔧 Getting started with C# Interactive](with-csharp-interactive.md) \ No newline at end of file diff --git a/docs/csharp/getting-started/with-visual-studio-2017.md b/docs/csharp/getting-started/with-visual-studio-2017.md deleted file mode 100644 index 0b05dec645be9..0000000000000 --- a/docs/csharp/getting-started/with-visual-studio-2017.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: Building a C# Hello World Application with .NET Core in Visual Studio 2017 -description: Learn how to build a simple .NET Core console application using Visual Studio 2017 -keywords: .NET Core, .NET Core console application, Visual Studio 2017 -author: stevehoag -ms.author: shoag -ms.date: 11/16/2016 -ms.topic: article -ms.prod: .net-core -ms.technology: devlang-csharp -ms.devlang: csharp -ms.assetid: 97aa50bf-bdf8-416d-a56c-ac77504c14ea ---- - -# Building a C# Hello World application with .NET Core in Visual Studio 2017 # - -This topic provides a step-by-step introduction to building, debugging, and publishing a simple .NET Core console application using Visual Studio 2017. Visual Studio 2017 provides a full-featured development environment for building .NET Core applications. As long as the application does not have any platform-specific dependencies, the application itself can run on any platform that .NET Core targets and on any system that has .NET Core installed. - -## The prerequisites ## - -In order to develop the application, Visual Studio 2017 must be installed on your machine. If you haven't already installed it, you can download a trial version of Visual Studio Professional or Visual Studio Enterprise, or you can download the free Visual Studio Community Edition, from [Visual Studio Downloads](https://www.visualstudio.com/downloads/). When you begin the installation, Visual Studio allows you to select the optional components to include in the installation, as the following figure shows. Choose the .NET Core and Docker (Preview) workload. - - ![Image](./media/select_core.jpg) - -## A simple "Hello World" application ## - -Let's begin by creating a simple "Hello World" console application. Here are the steps: - -1. Launch Visual Studio and, on the **File** menu, choose **New**, **Project**. In the **New Project** dialog, expand the **Visual C#** node in the left-hand pane, then choose the **.NET Core** node. - -1. In the right-hand pane, choose **Console App (.NET Core)**. Enter the name of the project, `HelloWorld`, and make sure that the **Create directory for solution** box is checked, as the following figure shows. - - ![Image](./media/vs_newproject_2017.jpg) - - -1. Choose the **OK** button. Visual Studio displays its development environment with its code window, as the following figure shows. The C# Console Application template for .NET Core automatically defines a class, `Program`, with a single method, `Main`, that takes a @System.String array as an argument. `Main` is the application entry point, the method that is called automatically by the runtime when it launches the application. Any command-line arguments supplied when the application is launched are available in the *args* array. - - ![Image](./media/vs_devenv_2017.jpg) - - The template creates a very simple "Hello world" application -- it calls the @System.Console.WriteLine(System.String) method to display the literal string "Hello world!" to the console window. By selecting the "HelloWorld" button with the green arrow on the toolbar, you can run the program in Debug mode now. If you do, though, the console window is visible for only a very brief time interval before it closes. This occurs because the `Main` terminates and the application ends as soon as the single statement in the `Main` method executes. - -1. Let's have our existing application pause before it closes the console window. Add the following code immediately after the call to the @System.Console.WriteLine(System.String) method: - - ```cs - Console.Write("Press any key to continue..."); - Console.ReadKey(true); - ``` - This code prompts the user to press any key and then pauses the program until a key is pressed. - -1. On the menu bar, choose **Build**, **Build Solution**. This compiles your program to IL, an intermediate language that is then converted to binary code by a just-in-time (JIT) compiler. - -1. Run the program by selecting the "HelloWorld" button with the green arrow on the toolbar. The result is shown in the following figure. - - ![Image](./media/simple_hello.jpg) - -1. Press any key to close the window. - -## Enhancing the "Hello World" application ## - -Let's enhance our application to prompt the user for his or her name and then display it along with the date and time to the console window. To modify and test the program, do the following: - -1. Enter the following C# code in the code window immediately after the opening bracket that follows the `public static void Main(string[] args)` line and before the first closing bracket. - - [!CODE [GettingStarted#1](../../../samples/snippets/csharp/getting_started/with_visual_studio/helloworld.cs#1)] - - The following figure shows the resulting code window. - - ![Image](./media/codewindow_2017.jpg) - - This code displays "What is your name?" to the console and waits until the user enters a string followed by the Enter key. It stores this string to a variable named `name`. It also retrieves the value of the @System.DateTime.Now property, which contains the current local time, and assigns it to a variable named `date`. It then uses a [composite format string](../../standard/base-types/composite-format.md) to display these values to the console. - -1. Compile the program by choosing **Build**, **Build Solution**. This compiles your program to IL, an intermediate language that is then converted to binary code by a just-in-time (JIT) compiler. - -1. Run the program in debug mode in Visual Studio by selecting the green arrow on the toolbar, pressing F5, or choosing the **Debug**, **Start Debugging** menu item. After you respond to the prompts by entering a name and pressing the Enter key, the console window should look something like the following: - - ![Image](./media/console_2017.jpg) - -1. Press any key to close the console window. This ends debug mode. - -You've now created and run your simple application. To develop a professional application, there are still some additional steps that you can take to make your application ready for release: - -- For information on debugging your application, see [Debugging the Hello World Application](.\debugging-with-visual-studio-2017.md) - -- For information on developing a publishing a distributable version of your application, see [Publishing the Hello World application](./publishing-with-visual-studio-2017.md). - -## Related topics ## - - - -You can also develop a .NET Core console app on Mac, Linux, and Windows by using Visual Studio Code, a freely downloadable code editor. For a step-by-step tutorial, see [Getting Started with Visual Studio Code](.\with-visual-studio-code.md). \ No newline at end of file diff --git a/docs/csharp/getting-started/with-visual-studio.md b/docs/csharp/getting-started/with-visual-studio.md index fc6ebe504339f..91e2d8bd4190a 100644 --- a/docs/csharp/getting-started/with-visual-studio.md +++ b/docs/csharp/getting-started/with-visual-studio.md @@ -1,9 +1,89 @@ --- -redirect_url: /dotnet/articles/csharp/getting-started/with-visual-studio-2017 +title: Building a C# Hello World Application with .NET Core in Visual Studio 2017 +description: Learn how to build a simple .NET Core console application using Visual Studio 2017. +keywords: .NET Core, .NET Core console application, Visual Studio 2017 +author: stevehoag +ms.author: shoag +ms.date: 03/07/2016 +ms.topic: article +ms.prod: .net-core +ms.technology: devlang-csharp +ms.devlang: csharp +ms.assetid: 97aa50bf-bdf8-416d-a56c-ac77504c14ea --- -# Building a C# Hello World Application with .NET Core in Visual Studio 2015 # +# Building a C# Hello World application with .NET Core in Visual Studio 2017 # -## Content retired! +This topic provides a step-by-step introduction to building, debugging, and publishing a simple .NET Core console application using Visual Studio 2017. Visual Studio 2017 provides a full-featured development environment for building .NET Core applications. As long as the application does not have any platform-specific dependencies, the application itself can run on any platform that .NET Core targets and on any system that has .NET Core installed. -For a getting started tutorial on .NET Core and Visual Studio 2017, see [(Building a C# Hello World application with .NET Core in Visual Studio 2017](with-visual-studio-2017.md). \ No newline at end of file +## Prerequisites ## + +- [Visual Studio 2017](https://www.visualstudio.com/downloads/) with the ".NET Core cross-platform development" workload installed. + +For more information, see the [Visual Studio 2017](../../core/windows-prerequisites.md) section on the Windows prerequisites topic. + +## A simple "Hello World" application ## + +Let's begin by creating a simple "Hello World" console application. Here are the steps: + +1. Launch Visual Studio and, on the **File** menu, choose **New** > **Project**. In the **New Project** dialog, expand the **Visual C#** node in the left-hand pane, then choose the **.NET Core** node. + +2. In the right-hand pane, choose **Console App (.NET Core)**. Enter the name of the project, `HelloWorld`, and make sure that the **Create directory for solution** box is checked, as the following figure shows. + + ![Screenshot showing the New Project dialog with Console App selected](./media/with-visual-studio/vs_newproject.jpg) + +3. Choose the **OK** button. Visual Studio displays its development environment with its code window, as the following figure shows. The C# Console Application template for .NET Core automatically defines a class, `Program`, with a single method, `Main`, that takes a @System.String array as an argument. `Main` is the application entry point, the method that is called automatically by the runtime when it launches the application. Any command-line arguments supplied when the application is launched are available in the *args* array. + + ![Visual Studio and the new HelloWorld project](./media/with-visual-studio/vs_devenv.jpg) + + The template creates a very simple "Hello world" application -- it calls the @System.Console.WriteLine(System.String) method to display the literal string "Hello World!" to the console window. By selecting the "HelloWorld" button with the green arrow on the toolbar, you can run the program in Debug mode now. If you do, though, the console window is visible for only a very brief time interval before it closes. This occurs because the `Main` terminates and the application ends as soon as the single statement in the `Main` method executes. + +4. Let's have our existing application pause before it closes the console window. Add the following code immediately after the call to the @System.Console.WriteLine(System.String) method: + + ```cs + Console.Write("Press any key to continue..."); + Console.ReadKey(true); + ``` + This code prompts the user to press any key and then pauses the program until a key is pressed. + +5. On the menu bar, choose **Build**, **Build Solution**. This compiles your program to IL, an intermediate language that is then converted to binary code by a just-in-time (JIT) compiler. + +6. Run the program by selecting the "HelloWorld" button with the green arrow on the toolbar. The result is shown in the following figure. + + ![Image](./media/with-visual-studio/simple_hello.jpg) + +7. Press any key to close the window. + +## Enhancing the "Hello World" application ## + +Let's enhance our application to prompt the user for his or her name and then display it along with the date and time to the console window. To modify and test the program, do the following: + +1. Enter the following C# code in the code window immediately after the opening bracket that follows the `public static void Main(string[] args)` line and before the first closing bracket. + + [!CODE [GettingStarted#1](../../../samples/snippets/csharp/getting_started/with_visual_studio/helloworld.cs#1)] + + The following figure shows the resulting code window. + + ![The modified program running](./media/with-visual-studio/codewindow.jpg) + + This code displays "What is your name?" to the console and waits until the user enters a string followed by the Enter key. It stores this string to a variable named `name`. It also retrieves the value of the @System.DateTime.Now property, which contains the current local time, and assigns it to a variable named `date`. It then uses a [composite format string](../../standard/base-types/composite-format.md) to display these values to the console. + +2. Compile the program by choosing **Build** > **Build Solution**. This compiles your program to IL, an intermediate language that is then converted to binary code by a just-in-time (JIT) compiler. + +3. Run the program in debug mode in Visual Studio by selecting the green arrow on the toolbar, pressing F5, or choosing the **Debug** > **Start Debugging** menu item. After you respond to the prompts by entering a name and pressing the Enter key, the console window should look something like the following: + + ![The modified program running](./media/with-visual-studio/console.jpg) + +4. Press any key to close the console window. This ends debug mode. + +You've now created and run your simple application. To develop a professional application, there are still some additional steps that you can take to make your application ready for release: + +- For information on debugging your application, see [Debugging the Hello World Application](debugging-with-visual-studio-2017.md) + +- For information on developing a publishing a distributable version of your application, see [Publishing the Hello World application](publishing-with-visual-studio-2017.md). + +## Related topics ## + +Instead of a console application, you can also build a class library with .NET Core and Visual Studio 2017. For a step-by-step introduction, see [Building a class library with C# and .NET Core in Visual Studio 2017](library-with-visual-studio-2017.md). + +You can also develop a .NET Core console app on Mac, Linux, and Windows by using Visual Studio Code, a freely downloadable code editor. For a step-by-step tutorial, see [Getting Started with Visual Studio Code](with-visual-studio-code.md). \ No newline at end of file diff --git a/styleguide/template.md b/styleguide/template.md index ae040a6abb46f..ae81f0a5d586d 100644 --- a/styleguide/template.md +++ b/styleguide/template.md @@ -377,7 +377,7 @@ You can see an example of buttons in action at the [Intune docs](https://docs.mi > [!div class="op_single_selector"] - [macOS](../docs/core/tutorials/using-on-macos.md) -- [Windows](../docs/csharp/getting-started/with-visual-studio-2017.md) +- [Windows](../docs/csharp/getting-started/with-visual-studio.md) You can see an example of selectors in action at the [Intune docs](https://docs.microsoft.com/en-us/intune/deploy-use/what-to-tell-your-end-users-about-using-microsoft-intune#how-your-end-users-get-their-apps).