ASP.NET Core – RC2 Daily Builds

Based on last week’s ASP.NET Community Stand-up, we should see RC2 released in the second half of May.  Until then, you can work with the daily builds and use VS Code for debugging by following these steps, which are based on the April 12th community stand-up:

  • Install the .NET Core CLI Tools
  • Run the ASP.NET Core CLI Samples
  • Install and Configure VS Code
  • Debug the Samples in VS Code

I have included notes for setting this up on both Windows and Ubuntu.

Windows

I tested this on a Windows 10 VM that had previously had RC1 installed as well as an older build of the .NET Core CLI Tools.  I uninstalled both of them before continuing.

Install the .NET Core CLI Tools

Download the .NET Core SDK Installer.  After the installer completes, you can run dotnet --info to verify the installation:

win64-01-dotnet-info

Run the ASP.NET Core CLI Samples

Clone the ASP.NET Core CLI samples repository.

Navigate to the samples root folder and run dotnet restore.  You must run the restore command in the root folder since that is where the NuGet.Config file is located (it has the package source configuration for the daily builds).

After the restore has completed, navigate to the HelloWeb directory and run dotnet run.  The sample will start and you can browse to http://localhost:5000 to see the output.

win64-05-dotnet-run

Install and Configure VS Code

Install VS Code 1.0.

Download the latest omnisharp RC2 build.  You’ll want to download the vsix file;  the latest version at this time is csharp-1.0.4-rc2.vsix.

Don’t try to install the vsix by double-clicking it.  To install it you need to run VS Code and open the vsix file.  After you select the file, the dialog will close and it will look like nothing happened.  After a while (nearly 30 seconds on my VM), a confirmation message will display:

win64-05-vscode-vsix

Debug the Samples in VS Code

Restart VS Code and open the HelloWeb project folder.  VS Code will display a status message at the bottom indicating it is downloading the .NET Core debugger.  This took several minutes for me, so be patient.

Once you install the debugger, you can set breakpoints and bring up the debug panel (the debug icon on the left, or Ctrl+Shift+D).  In the debug launch options drop-down, choose “.NET Core Launch (console)”.

win64-07-vscode-debugger

Start debugging and you’ll hit your breakpoint and now you can inspect locals, view the call stack, etc.:

win64-08-vscode-debugger

Ubuntu

I started with a fresh VM of Ubuntu 14.04 that had 3D acceleration disabled (VS Code exhibits odd graphical behavior when 3D acceleration is enabled).

Install the .NET Core CLI Tools

Download and install the latest packages for the shared host, shared framework, and sdk, in that order as per the instructions.

To install the host package, navigate to its location and run the following command:

The following commands install the shared framework package.  The initial dpkg command failed, reporting missing dependencies, and the apt-get command immediately afterwards installed the dependencies along with the shared framework package:

Similarly, the sdk package reported missing dependencies, and an apt-get command took care of that:

You can run dotnet --info to verify the installation:

dotnet-info

Run the ASP.NET Core CLI Samples

Clone the ASP.NET Core CLI samples repository.

Run dotnet restore in the samples root folder, where the NuGet.Config file is located.  After the restore has completed, navigate to the HelloWeb directory and run dotnet run.  The sample will start and you can browse to http://localhost:5000 to see the output.

dotnet-run

Install and Configure VS Code

Download the VS Code package for Ubuntu.  Navigate to the file and run the following command:

Use the following command to find the location of the installed files:

Create a symlink so we can run it anywhere:

Adding RC2 support for VS Code is exactly the same as on Windows.

Download the latest omnisharp RC2 build.  You’ll want to download the vsix file;  the latest version at this time is csharp-1.0.4-rc2.vsix.

Don’t try to install the vsix by double-clicking it.  To install it you need to run VS Code and open the vsix file.  After you select the file, the dialog will close and it will look like nothing happened.  After a while (nearly 30 seconds on my VM), a confirmation message will display:

vscode-vsix

Debug the Samples in VS Code

Open the HelloWeb sample in VS Code.  You’ll see a message along the bottom saying that VS Code is downloading the .NET Core debugger.  This may take several minutes.

After the debugger is successfully installed, you can set a breakpoint and click the debug icon on the left (or click Ctrl+Shift+D).  In the launch option drop-down, choose “.NET Core Launch (console)” and start debugging.

vscode-debug

One difference here from Windows:  when you hit the breakpoint, variable inspection in the side panels does not work.  You can hover over a variable, or use the Debug Console to type in a variable name.  Either way allows you to inspect variables.

vscode-breakpoint

Uninstalling

Use this command to get the installed package names:

Then the following commands to uninstall the packages:

 

1 Comment

  1. […] Note:  these projects use the RC2 daily builds; to use the dailies, please see this post. […]

Leave a Reply