Skip to content

Installation and Setup

Zach Goethel edited this page Feb 19, 2024 · 15 revisions

Start by finding the latest release to get all the necessary files.

Install the Language Server

  1. If you have previously installed the server, uninstall the previous version.

    a. Search for "Add or remove programs" in the Start menu.

    b. Find and uninstall "SourceGenerator.Installer" from the list.

  2. Download the language server installer (.exe) or binaries (.zip).

    a. If you opt for the installer, run and complete the installation process.

    b. If you opt for the binaries, extract the files to a convenient location.

  3. Keep the language server running any time Visual Studio is open.

Note: Running Visual Studio while the language server is not active will result in timeout-related compilation errors and frozen editor screens within Visual Studio. Solutions which do not involve .view or .model files are unaffected.

Install the Syntax Highlighting Extension

  1. If you have previously installed the extension, uninstall the previous version.

    a. In Visual Studio, open "Extensions -> Manage Extensions..."

    b. Select "Installed."

    c. Find and uninstall "SourceGenerator.VsEditor" from the list.

  2. Download and install the latest .vsix.

Project Setup Without a Template

  1. Create a new .NET Class Library for generated content.

  2. Create a folder within that project named .\Tools\SourceGenerator.VsAdapter\.

  3. Extract the latest .VsAdapter.zip into the folder.

  4. In Visual Studio, right click on the Project and click "Edit Project File."

    a. In <PropertyGroup>, add <Nullable>disable</Nullable>

    b. Create the following node inside of <Project>:

<ItemGroup>
  <AdditionalFiles Include="**\*.model" />
  <AdditionalFiles Include="**\*.view" />
</ItemGroup>

Projects Which Reference .Includes

Clone this wiki locally