Getting Started - VS Code guidance
By using free software anyone in Arup can create libraries for ArupCompute.
Installation
.Net Core SDK
To install .Net Core SDK 6.0 request it from Arup apps.
To ensure that the .Net Core SDK has downloaded and installed properly from ArupApps open up a terminal (either PowerShell or the command prompt) and type the command dotnet --info
. You should see some runtime, host and SDK versioning information printed. If instead you see an error (dotnet is not recognized as an internal or external command
) raise a ticket with IT support.
VS Code
To install Visual Studio Code download it from the VS Code website. Ensure that you select the 'User Installer' as this will install without admin privileges.
C# extension
VS Code does not natively support any programming languages, instead this is enabled by installing extensions. For this tutorial we will install the C# plugin.
Azure Artefacts credential provider
Ensure access
Some of the development libraries are hosted and protected on an Arup code repository. To ensure you have access first click on this link and accept any login requests that appear.
If successful you should see some data like in the image below.
Install cred provider
To install the Azure Artefacts credential provider:
- Download the helper script from here
- Open PowerShell
- Write in the follow command (ensuring to replace the filepath to suit where you have downloaded the code to)
PowerShell.exe -ExecutionPolicy Bypass -File "C:\full\path\to\file\installcredprovider.ps1"
- Press Enter
- Some output will appear on the page and a success message
Skip this whole section if you have used the template repository
Steps:
- Create a new folder on your hard drive
- Open up a terminal within the folder
- Run the command
dotnet new classlib
The library will be created at the path the command prompt is in. You can move down directories with the command cd <foldername>
, and move up with cd ..
All subsequent dotnet
commands must be executed from the same directory as your <myprojectname>.csproj
file.
Adding reference libraries to our project
To add the reference libraries run the commands:
dotnet add package Arup.Compute.DotNetSdk --interactive
Testing your code
If you have a test library in your solution run dotnet test
from the command line