Godot.DependencyInjection 0.3.0

.NET 6.0
dotnet add package Godot.DependencyInjection --version 0.3.0
NuGet\Install-Package Godot.DependencyInjection -Version 0.3.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Godot.DependencyInjection" Version="0.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Godot.DependencyInjection --version 0.3.0
#r "nuget: Godot.DependencyInjection, 0.3.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Godot.DependencyInjection as a Cake Addin
#addin nuget:?package=Godot.DependencyInjection&version=0.3.0

// Install Godot.DependencyInjection as a Cake Tool
#tool nuget:?package=Godot.DependencyInjection&version=0.3.0


Godot.DependencyInjection is a lightweight and easy-to-use dependency injection framework for the Godot game engine, specifically tailored for C#. It aims to help developers create more modular, testable, and maintainable game projects using the Godot engine.


  • Easy to set up and use
  • Supports property, field, and method injection
  • Provides member dependency injection for usage with resources
  • Utilizes standard C# dependency injection abstractions
  • Supports transient, scoped, and singleton lifetimes


You can install the package via NuGet or clone the repository and add a project reference to the solution created by Godot.


using Godot.DependencyInjection.Services.Input;

public partial class RegularNode : Node2D
    public IInputService inputService;

    public IService Service { get; set; }

    public IService[] Services1 { get; set; }

    public IEnumerable<IService> Services2 { get; set; }

    public CustomResource Resource { get; set; }

    public void Inject(IService service, IService[] services1, IEnumerable<IService> services2)
        // ***


  1. Create a script for dependency manager:
    public partial class DependencyInjectionNode : DependencyInjectionManagerNode
  2. Add the script to Project → Project Settings → Autoload.
  3. Create a Node and script for dependency registration:
    public partial class DependencyRegistrationNode : Node, IServicesConfigurator
        public void ConfigureServices(IServiceCollection services)
            services.AddTransient<IService, Service>();
  4. Add dependency registration node to scene


Please note that this project is in its early stages of development and may require significant improvements. The framework is functional but may not be suitable for production use in its current state. Any feedback, suggestions, or contributions to improve the framework are highly appreciated.


I'm currently in the process of reevaluating the architecture and scope of the project, so only pull requests containing changes to documentation might be merged. If you have any ideas for code improvements, please create a new issue instead.


If you have any questions, issues, or suggestions, please create a new issue on the GitHub repository.


This project is licensed under the MIT License. See the LICENSE file for more information.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.3.0 41 9/22/2023
0.2.3 141 4/27/2023
0.2.2 123 4/26/2023
0.2.1 120 4/25/2023
0.2.0 116 4/25/2023
0.1.1 138 4/23/2023
0.1.0 122 4/23/2023