SkillAgentSearch skills...

VContainerAnalyzer

Roslyn Analyzer for Unity Project with VContainer.

Install / Use

/learn @VeyronSakai/VContainerAnalyzer
About this skill

Quality Score

0/100

Supported Platforms

Universal

Tags

README

VContainerAnalyzer

Test NuGet

Roslyn Analyzer for detecting coding errors in Unity projects using VContainer.

[!WARNING] This is in a very early stage of development. Please use with caution.

Setup

Unity Package Manager

VContainerAnalyzer can be set up via Unity Package Manager by following the steps below.

  1. Open the Package Manager in the UnityEditor.
  2. Select the + button in the upper left corner.
  3. Select Add package from git URL.
  4. Enter https://github.com/VeyronSakai/VContainerAnalyzer.git?path=VContainerAnalyzer.Unity/Assets/Plugins/VContainerAnalyzer and Select Add button.
  5. Add VContainer.Analyzer to the Assembly Definition References of the asmdef to which you want to apply Analyzer.

.unitypackage

VContainerAnalyzer can be set up by using the .unitypackage available at Releases.

Rules

VContainer0001

| Topic | Value | |:---------|:---------------| | Id | VContainer0001 | | Severity | Error | | Enabled | True | | Category | Usage |

An error occurs if the constructor of a class registered by the Register() or RegisterEntryPoint() or UseEntryPoints() methods in the Lifetime class does not have an Attribute that extends PreserveAttribute such as InjectAttribute.

See the VContainer documentation for more information.

[!CAUTION] Analysis is not supported for System class inheriting from Unity.Entities.SystemBase. This is because VContainer's ECS support is beta. Also, currently the analysis is performed without considering link.xml.

VContainer0002

| Topic | Value | |:---------|:---------------| | Id | VContainer0002 | | Severity | Warning | | Enabled | True | | Category | Usage |

Warning occurs when using Property/Field Injection.

public class FieldInjectionSandbox
{
    [Inject] private IService _field;
}

public class PropertyInjectionSandbox
{
    [Inject] private IService Property { get; set; }
}

See the VContainer documentation for more information.

Contribution

Bugs and new feature suggestions are welcome in issues and Pull Requests.


Analyzer based on the Roslyn Analyzer Template.

View on GitHub
GitHub Stars5
CategoryDevelopment
Updated1mo ago
Forks0

Languages

C#

Security Score

85/100

Audited on Feb 27, 2026

No findings