1

I am new to using C# assemblies. I am working on the C# script of an old project in Unity 2019.4.4f1 and I tried adding the SixLabors' ImageSharp assembly to the project but still get the Type or namespace 'SixLabors' could not be found (are you missing a using directive or an assembly reference?) error.

The script where the error arises from is located in the ProjectName/Assets/SomeNestedFolders folder and I made sure to include the following lines at the beginning of this script :

using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.Formats.Jpeg;

As this is a legacy project format there is no .csproj file to modify. Is there a step to reference the assembly that I forgot or a file to modify further?

The ImageSharp version I used is the 2.1.4 one as it's the last one compatible with the .NET Framework 4.7.1. As I'm working on Linux and the project format is legacy (or non-SDK) I had to use Nuget CLI and a packages.config instead of the VSCode NuGet Package Manager to install ImageSharp into the ProjectName/Packages folder (where other assemblies where previously installed by coworkers before I arrived. Those coworkers are long gone though, and I have now way of contacting them...).

I've tried reimporting all assets inside Unity's Packages folder, and I don't find any "Add reference" button to add a .dll reference as found in other related questions.

0 Answers0