These are detailed instructions on how to build the DisCatSharp library under various environmnets.
It is recommended you have prior experience with multi-target .NET Core/Standard projects, as well as the dotnet
CLI utility, and MSBuild.
In order to build the library, you will first need to install some software.
On Windows, we only officially support Visual Studio 2019 16.10 or newer. Visual Studio Code and other IDEs might work, but are generally not supported or even guaranteed to work properly.
- Windows 10 - while we support running the library on Windows 7 and above, we only support building on Windows 10 and better.
- Git for Windows - required to clone the repository.
- Visual Studio 2022 - community edition or better. We do not support Visual Studio 2021 and older.
- Windows PowerShell - required to run the build scripts. You need to make sure your script execution policy allows execution of unsigned scripts.
- .NET SDK 7.0 - required to build the project.
On GNU/Linux, we support building via Visual Studio Code and .NET Core SDK. Other IDEs might work, but are not supported or guaranteed to work properly.
While these should apply to any modern distribution, we only test against Debian 10. Your mileage may vary.
When installing the below, make sure you install all the dependencies properly. We might ship a build environment as a docker container in the future.
- Any modern GNU/Linux distribution - like Debian 10.
- Git - to clone the repository.
- Visual Studio Code - a recent version is required.
- C# for Visual Studio Code (powered by OmniSharp) - required for syntax highlighting and basic Intellisense
- .NET SDK 7.0 - required to build the project.
- Mono 5.x - required to build the .NETFX 4.5, 4.6, and 4.7 targets, as well as to build the docs.
- PowerShell Core - required to execute the build scripts.
Once you install all the necessary prerequisites, you can proceed to building. These instructions assume you have already cloned the repository.
Building on Windows is relatively easy. There's 2 ways to build the project:
Building through Visual Studio yields just binaries you can use in your projects.
- Open the solution in Visual Studio.
- Set the configuration to Release.
- Select Build > Build Solution to build the project.
- Select Build > Publish DisCatSharp to publish the binaries.
Building this way outputs NuGet packages, and a documentation package. Ensure you have an internet connection available, as the script will install programs necessary to build the documentation.
- Open PowerShell and navigate to the directory which you cloned DisCatSharp to.
- Execute
.\DisCatSharp.Tools\rebuild-lib.ps1 -ArtifactLocation .\dcs-artifacts -Configuration Release
and wait for the script to finish execution. - Once it's done, the artifacts will be available in dcs-artifacts directory, next to the directory to which the repository is cloned.
When all necessary prerequisites are installed, you can proceed to building. There are technically 2 ways to build the library, though both of them perform the same steps, they are just invoked slightly differently.
- Open Visual Studio Code and open the folder to which you cloned DisCatSharp as your workspace.
- Select Build > Run Task...
- Select
buildRelease
task and wait for it to finish. - The artifacts will be placed in dcs-artifacts directory, next to where the repository is cloned.
- Open PowerShell (
pwsh
) and navigate to the directory which you cloned DisCatSharp to. - Execute
./DisCatSharp.Tools/rebuild-lib.ps1 -ArtifactLocation ./dcs-artifacts -Configuration Release
and wait for the script to finish execution. - Once it's done, the artifacts will be available in dcs-artifacts directory, next to the directory to which the repository is cloned.