I have a tools addon for my gamemode that has attributes that are used in said gamemode. After adding a reference to my tools addon in my gamemode addon, everything seems to work and VS2022 will build the solution without errors; however, when I launch s&box the gamemode compilation fails and upon inspection the reference to my tools addon is removed.
To Reproduce
Copy the tool snippet and paste it into a minimal tool addon.
Copy the gamemode snippet and paste it into a minimal gamemode addon.
Add a reference to the tool addon in the gamemode so the MyToolAttribute can be used.
Open s&box.
Upon inspection, the reference to the tool addon will be removed.
Expected behavior
The reference is not removed and my gamemode can use the tools that are build for it.
Media/Files
The tool addon's attribute:
// From the tool addon.
using System;
namespace MyTools
{
public class MyToolAttribute : Attribute
{
public string Property { get; set; }
public MyToolAttribute( string property )
{
Property = property;
}
}
}
The tool addon's attribute being used in the gamemode:
// From the gamemode addon
using MyTools;
using Sandbox;
namespace MyGamemode
{
[GameResource( "Test Definition", "test", "Describes a test resource." )]
public class TestResource : GameResource
{
[MyTool( "Foo" )]
public string Bar { get; set; }
}
}
Describe the bug
I have a tools addon for my gamemode that has attributes that are used in said gamemode. After adding a reference to my tools addon in my gamemode addon, everything seems to work and VS2022 will build the solution without errors; however, when I launch s&box the gamemode compilation fails and upon inspection the reference to my tools addon is removed.
To Reproduce
Expected behavior
The reference is not removed and my gamemode can use the tools that are build for it.
Media/Files
The tool addon's attribute:
The tool addon's attribute being used in the gamemode:
Additional context
No response