Skip to content

IgnoresAccessChecksTo doesn't work with Reflection.Emit #8

@SolidAlloy

Description

@SolidAlloy

To overcome an issue with the inability to use internal generic UnityEngine.Objects, I tried adding the IgnoresAccessChecksTo attribute when emitting assemblies.
This seems to be working at least for these guys.

However, when creating an asset from an internal generic type, I receive the following error:

MethodAccessException: Method `Testing.GenericSO`1[System.Boolean]..ctor()' is inaccessible from method `ConcreteClass_d9b9a1d4e06775a45aa383810177c43c..ctor()'

I added a dirty example of how IgnoresAccessChecksTo can be used in the plugin to the ignores-access-checks-to branch. Feel free to check it out.

When I created a concrete class manually using OpenSesame, it was instatiated without the MethodAccessException error, so something's wrong with emitting IgnoresAccessChecksTo in Reflection.Emit.

Does anyone have an idea, what else can be done to bypass the visibility check for internal generic types?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions