Skip to content

SourceGenerator.dll fIle path different #4

@Aldruun

Description

@Aldruun

I've installed Unity editor 6.4 (6000.4.5f1) and the new path to SourceGenerators is "C:\Program Files\Unity\Hub\Editor\6000.4.5f1\Editor\Data\Tools\BuildPipeline\Compilation\Unity.SourceGenerators\Unity.SourceGenerators.dll"
The Tools\SourceGenerators\ folder is gone.

I've adjusted PatchChecker.cs to get rid of the path errors. But the patcher is still looking for the old path.

public static class PatchChecker
{
    public static bool IsPatched()
    {
        // New Unity 6 layout
        string editorPath = EditorApplication.applicationContentsPath;
        string path = Path.Combine(
            editorPath,
            "Tools",
            "BuildPipeline",
            "Compilation",
            "Unity.SourceGenerators",
            "Unity.SourceGenerators.dll"
        );

        try
        {
            using AssemblyDefinition asm = AssemblyDefinition.ReadAssembly(path);
            return asm.MainModule.GetTypes().Any(t => t.Name == "CSharp11NamespacePatch");
        }
        catch(System.IO.FileNotFoundException)
        {
            UnityEngine.Debug.LogError($"Unity.SourceGenerators.dll not found at: {path}");
            return false;
        }
        catch(System.Exception e)
        {
            UnityEngine.Debug.LogError($"PatchChecker error: {e.Message}");
            return false;
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions