-
Notifications
You must be signed in to change notification settings - Fork 0
Installation and Setup
Start by finding the latest release to get all the necessary files.
-
If you have previously installed the server, uninstall the old version.
a. Search for "Add or remove programs" in the Start menu.
b. Find and uninstall "SourceGenerator.Installer" from the list.
-
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.
-
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.
-
If you have previously installed the extension, uninstall the old version.
a. In Visual Studio, open "Extensions -> Manage Extensions..."
b. Select "Installed."
c. Find and uninstall "SourceGenerator.VsEditor" from the list.
-
Download and install the latest
.vsix
.
-
Create a new .NET Class Library for generated content.
-
Create a folder within that project named
.\Tools\SourceGenerator.VsAdapter\
.a. Extract the latest
.VsAdapter.zip
into the folder. -
Create another folder named
.\Tools\SourceGenerator.Includes
.a Download and place the latest
.Includes.dll
into the folder. -
In Visual Studio, right click on the Project and click "Edit Project File."
a. Replace the
<Project>
node with<Project Sdk="Microsoft.NET.Sdk">
.b. In
<PropertyGroup>
, add<Nullable>disable</Nullable>
.c. Create the following nodes inside of
<Project>
:
<ItemGroup>
<AdditionalFiles Include="**\*.model" />
<AdditionalFiles Include="**\*.view" />
</ItemGroup>
<ItemGroup>
<Analyzer Include="Tools\SourceGenerator.VsAdapter\SourceGenerator.VsAdapter.dll" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="SourceGenerator.Includes">
<HintPath>Tools\SourceGenerator.Includes\SourceGenerator.Includes.dll</HintPath>
</Reference>
</ItemGroup>
Now any .model
or .view
files in the project will be compiled, and the generated sources can
be used by other projects in the Solution.