Getting Started with Eco Modding in Visual Studio

From Eco - English Wiki
Revision as of 20:36, 29 July 2025 by WugWugg (talk | contribs) (Writing large portions, but my Eco server needs me!)

Introduction

This guide covers how you could use Visual Studio 2022 as the development environment for your Eco mods — from creating your project to building, testing, and releasing a mod.

This guide won’t teach you how to code or write a mod, but it will help you get everything set up so you’re ready to start learning. There will be helpful resources for learning listed at the bottom of this guide.

Have Ready

  • A copy of the Eco game installed
  • A file explorer and the file-path to Eco folder
    • At the time of writing, within this folder there's folders like D3D12 and Eco_Data. Also, you'll find the Eco.exe file here. There are other files and folder here too, but this list is just to help you know what the folder looks like.

Note: Find Folder with Steam

Steam users can find the install folder by right-clicking on the game in your Steam Library:

Shows a Steam Library with a menu open over the Eco game. Highlighted in that menu is a "Manage" option, opening a sub-menu. The sub-menu has "Browse local files" highlighted.

Installing Visual Studio 2022

Visual Studio 2022 (VS2022) has a completely free to use version called the Community Edition. This guide is written assuming that's the version used.

Go to https://visualstudio.microsoft.com/downloads/#visual-studio-community-2022 and look for the "Visual Studio Community 2022" download. At the time of writing, the download button looked like:

A picture of a website showing a row. The first column has the name "Visual Studio Community 2022" and there's a "Download" button two columns to the right, past it's description text.

Start the download by clicking on the Download button.

Then, run the installer till this the installer gets to the Workloads page. On this page, select these workloads:

  • .NET desktop development -- Required for any mod development
  • ASP.NET and web development -- Optional. If you want to interact with external websites or Eco's own web server (e.g. Discord's web-hooks or extending the API)

Note: Using the Workflow installation page is easy, but will install a few extra things (e.g. GitHub Copilot). If you want to keep the tooling minimal you can just install .NET from dotnet.microsoft.com/en-us/download. At the time of writing, Eco supports .NET version 8.0. See the later section .NET Version of this guide to learn how to check if that has changed.

At the time of writing, this is what the Workloads page looks like with those options selected:

Workloads screen during VS2022 installation. Options selected are "ASP.NET and web development" and ".NET desktop development".

Click the Install button. It will take a few minutes to complete installation. By default, it should launch VS2022 after it installs.

It will ask you to sign in. You do not need to and can completely avoid this by clicking the Skip and add accounts later option in tiny text below the buttons.

If you plan to upload your mod to Github, VS2022 does have integrated support for GitHub. So consider signing in with GitHub to make that process easier.

This guide is continuing as if the Skip and add accounts later option was selected. Finally, it might ask what color theme you'd like. Select your preference and continue.

Installation Complete!

The Mod

With Eco and VS2022 are installed all of the tools needed to code, build, and run a mod are ready!

Creating a New Project

When VS2022 first opens it will show you a dashboard where you can quickly select what you want to do. On the left, are any recent projects opened. There won't be any if this is the first time installing it.

On the right there will be a few options, from here select the Create a new project option.

VS2022's launch dashboard showing recent projects on the left and quick action buttons on the right. Highlighted is a button titled "Create a new project".

Now, it's time to go through the new project wizard. First, the wizard asks what kind of project is being made.

To mod Eco we need to make a C# Class Library.

To find the template, search C# library in the search bar. Select the C# option titled Class Library.

It's important to pay attention to the icon and chips below the title and description. Make sure you select the C# option as there are other options similarly named Class Library.

location=center

The next page will ask you what the Project Name should be. Type the name of the mod being created.

The other options like the Location and the Solution Name do not need edited.

Leave the box Place solution and project in the same directory unchecked.

Click the Next button and continue along in the next section of this guide.

.NET Version

At the time of writing, Eco targets .NET 8.0 and the mod should too.

It's suggested to confirm the version of .NET that Eco uses by looking at the .NET version the reference assemblies use.

The reference assemblies can be found on the NuGet Gallery by searching for Eco.ReferenceAssemblies. See: www.nuget.org/packages?q=Eco.ReferenceAssemblies

Find the package with the name Eco.ReferenceAssemblies made by StrangeLoopGames.

There will be a chip underneath of it with the .NET version it targets. At the time of writing, this is what that page looked like:

Shows the search result of Eco.ReferenceAssemblies. In a blue chip the text ".NET 8.0" can be seen.

By clicking on that search result (shown above), a more detailed page opens is show. Again, there's chips showing what version of .NET to use:

Show the package page for "Eco.ReferenceAssemblies" on NuGet Gallery. Circled in red are two chips with some version of the text ".NET 8.0" inside them.


Back to VS2022

On the Additional Information page, there's the Framework drop-down. Select the same version of .NET Eco uses (as described above).

Click the Create button to finish creating the mod!

Linking to Eco Assemblies

Look for the Solution Explorer on the right-hand side of VS2022. It should look something like this:

Note: If the solution explorer isn't there, open it from the top menu. Click the View button and select Solution Explorer from the menu.

A picture of a basic layout in Visual Studio 2022 with the Solution Explorer open on the right-hand side. The solution explorer is circled in red.

From the Solution Explorer, find the References line and right-click on it. On that menu select Manage NuGet packages...

Shows VS2022's Solution Explorer with project expanded. The References line is highlighted and a menu is open. On that menu the "Manage NuGet Packages" line is highlighted.

This will open a new tab. Above the search bar there's sub-tabs. Select the Browse sub-tab.

Type Eco.ReferenceAssemblies into the search bar.

Check the Include prerelease check-box.

Find the option with the name Eco.ReferenceAssemblies made by StrangeLoopGames. Click on it.

A details panel will show up to the right. It will show the version of the reference assemblies being targeted. By default it chooses the latest and can be left at it's default.

Click the Install button.

VS2022 is open to the NuGet tab and is searching with the text Eco.ReferenceAssemblies. The checkbox to the right of the search is checked -- include prerelease. The only search result is selected. There is yellow highlights over part of the photo.

Click the Apply button on the popup to finish adding the references.

The reference assemblies have now been added! When coding VS2022 will provide IntelliSense popups. Try it out by going back to the Class1.cs file and typing Eco. and you will see suggestion pop up. It’s an essential tool for a lot of modders.

Shows a text editor with a basic class file. Inside there's the text "Eco." and a menu that show the suggested namespaces within.

Building The DLL

To build the mod into a Dynamic Linked Library

Setting up Debugging

Releasing a Mod

Mod.io

Eco Forms

Where to Next?

  • Where to learn modding logic (Eco Modding Wiki, Discord, sample mods)
  • Consider source control (Git)
  • Explore Eco’s open-source mod projects for ideas