Latest builds + instructions

LATEST DOWNLOAD (1/24/24):
https://afterschoolstudio.s3.amazonaws.com/dinghy/ea-builds/Dinghy.1.0.0.nupkg


Dinghy runs on dotnet, so you’ll need to have dotnet downloaded in order to use it:

Dinghy is distributed as a NuGet package. To consume this, add a local nuget source to your IDE that points to the package:

Visual Studio:

Rider:

After you add the source you should see the Dinghy package (probably put it somewhere near the project).

If you’re in VS Code, you need to manually create a nuget.config file in the base of your project (next to your sln). Add this to that file, pointing to where you have the Dinghy nuget package:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="MyGet" value="C:/etc/etc/etc" />
  </packageSources>
</configuration>

Then from the dotnet console run:

dotnet add package Dinghy

That should work.

Not sure if I missed a step or because am just very inexperienced in handling .net projects, but I’ve been able to install the Dinghy nuget package, but when I build and run the init code sample I get an error as Dinghy is unable to load sokol:

Unhandled exception. System.DllNotFoundException: Unable to load shared library 'sokol' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: 
dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.1/sokol.dylib, 0x0001): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.1/sokol.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.1/sokol.dylib' (no such file), '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.1/sokol.dylib' (no such file)
dlopen(/Users/nic/Projects/dinghy/dinghytest/ConsoleApp/bin/Debug/net8.0/sokol.dylib, 0x0001): tried: '/Users/nic/Projects/dinghy/dinghytest/ConsoleApp/bin/Debug/net8.0/sokol.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/nic/Projects/dinghy/dinghytest/ConsoleApp/bin/Debug/net8.0/sokol.dylib' (no such file), '/Users/nic/Projects/dinghy/dinghytest/ConsoleApp/bin/Debug/net8.0/sokol.dylib' (no such file)
dlopen(sokol.dylib, 0x0001): tried: 'sokol.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSsokol.dylib' (no such file), '/usr/lib/sokol.dylib' (no such file, not in dyld cache), 'sokol.dylib' (no such file), '/usr/local/lib/sokol.dylib' (no such file), '/usr/lib/sokol.dylib' (no such file, not in dyld cache)
dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.1/libsokol.dylib, 0x0001): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.1/libsokol.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.1/libsokol.dylib' (no such file), '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.1/libsokol.dylib' (no such file)
dlopen(/Users/nic/Projects/dinghy/dinghytest/ConsoleApp/bin/Debug/net8.0/libsokol.dylib, 0x0001): tried: '/Users/nic/Projects/dinghy/dinghytest/ConsoleApp/bin/Debug/net8.0/libsokol.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/nic/Projects/dinghy/dinghytest/ConsoleApp/bin/Debug/net8.0/libsokol.dylib' (no such file), '/Users/nic/Projects/dinghy/dinghytest/ConsoleApp/bin/Debug/net8.0/libsokol.dylib' (no such file)
dlopen(libsokol.dylib, 0x0001): tried: 'libsokol.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibsokol.dylib' (no such file), '/usr/lib/libsokol.dylib' (no such file, not in dyld cache), 'libsokol.dylib' (no such file), '/usr/local/lib/libsokol.dylib' (no such file), '/usr/lib/libsokol.dylib' (no such file, not in dyld cache)
dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.1/sokol, 0x0001): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.1/sokol' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.1/sokol' (no such file), '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.1/sokol' (no such file)
dlopen(/Users/nic/Projects/dinghy/dinghytest/ConsoleApp/bin/Debug/net8.0/sokol, 0x0001): tried: '/Users/nic/Projects/dinghy/dinghytest/ConsoleApp/bin/Debug/net8.0/sokol' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/nic/Projects/dinghy/dinghytest/ConsoleApp/bin/Debug/net8.0/sokol' (no such file), '/Users/nic/Projects/dinghy/dinghytest/ConsoleApp/bin/Debug/net8.0/sokol' (no such file)
dlopen(sokol, 0x0001): tried: 'sokol' (no such file), '/System/Volumes/Preboot/Cryptexes/OSsokol' (no such file), '/usr/lib/sokol' (no such file, not in dyld cache), 'sokol' (no such file), '/usr/local/lib/sokol' (no such file), '/usr/lib/sokol' (no such file, not in dyld cache)
dlopen(/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.1/libsokol, 0x0001): tried: '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.1/libsokol' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.1/libsokol' (no such file), '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/8.0.1/libsokol' (no such file)
dlopen(/Users/nic/Projects/dinghy/dinghytest/ConsoleApp/bin/Debug/net8.0/libsokol, 0x0001): tried: '/Users/nic/Projects/dinghy/dinghytest/ConsoleApp/bin/Debug/net8.0/libsokol' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/nic/Projects/dinghy/dinghytest/ConsoleApp/bin/Debug/net8.0/libsokol' (no such file), '/Users/nic/Projects/dinghy/dinghytest/ConsoleApp/bin/Debug/net8.0/libsokol' (no such file)
dlopen(libsokol, 0x0001): tried: 'libsokol' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibsokol' (no such file), '/usr/lib/libsokol' (no such file, not in dyld cache), 'libsokol' (no such file), '/usr/local/lib/libsokol' (no such file), '/usr/lib/libsokol' (no such file, not in dyld cache)

   at Dinghy.Internal.Sokol.App.run(sapp_desc* desc)
   at Dinghy.Engine.Boot(RunOptions opts)
   at Dinghy.Engine.Run(RunOptions opts)
   at Program.<Main>$(String[] args) in /Users/nic/Projects/dinghy/dinghytest/ConsoleApp/Program.cs:line 3

I am on a arm Mac going through vscode

Hey Nic! Great to have you and happy to know you’re giving Dinghy a run!

Most of my development is on an M1 Mac so I know it does work here. I think it’s probably an issue with your nuget.config/csproj files, especially if you’re doing it all through VS Code (which is generally worse at solution management for C# stuff — thought definitely check out the new C# dev tools thing if you haven’t — it’s a modern alternative to Omnisharp and I think it’s great for everything (except Unity — Unity still needs you to use Omnisharp iirc).

I’d check first your .csproj file to make sure you’re actually including Dinghy in the build:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net8.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Dinghy" Version="1.0.0" />
  </ItemGroup>
</Project>

Then I’d check your nuget config is pointing to the right place for where the nuget package is:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <packageSources>
        <!-- package source is additive -->
        <add key="Dinghy Local Release" value="../Dinghy/Dinghy.Core/bin/Release" />
    </packageSources>
</configuration>

You may also need to run dotnet restore at the command line to make sure everything is up to date. If you’re especially paranoid, you can run this in one go to get a clean build everytime:

dotnet clean && dotnet restore && dotnet clean && dotnet build-server shutdown && dotnet build && dotnet run

Dotnet is iffy on caching things, and this usually cleans out most cache stuff (like the bin + obj folders)

Anytime after that though you should just be able to do:

dotnet build && dotnet run

The main thing is getting it to resolve Dinghy in the first place.

Let me know if that works for you!

@nic Following up here as I was just debugging something else on my end — it looks like the nuget package had labeled the binaries for ARM mac’s (M1,etc.) as osx-x64 instead of osx-arm64, so if you’re consuming the nuget package on a new dotnet 8 console app I think that changes how it forces RIDs so it may be looking in the wrong place.

If none of the other above stuff worked and you’re still getting errors, a quick fix is to explicitly build your project as osx-64 like:

dotnet build myproject.csproj -r osx-x64

This will emit the dependent libraries to the build output in bin.

Then build for arm like this:

dotnet build myproject.csproj -r osx-arm64

Which will produce a folder with none of the correct DLLS in it. However, you can just copy the sokol/cute/stb dlls from the osx-x64 output and paste them in here and that should work.


I’m working on a patch of the library that fixes this and a few other things since the first release, so hoping it’s just some short term pain for now but should be better imminently.

Hey Kyle! Glad to be here, excited to give things a spin once I have a free moment. Your second solution worked, copying the dylibs from the x64 folder got everything up and running. Thanks!