You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Publicizing an assembly which contain private methods that are overrides from a base class/interface causes ambiguity errors in certain IDE's (Rider in my case).
I remember fixing this using a custom assembly publicizer a while back by not publicizing the overridden method, and it looked something like this:
foreach(var method in type.Methods){// Detect whether or not this method is present multiple times (as an override)// This will only publicize the method defined by the type, and keeps the overridden method as-isif(!method.HasOverrides ||
type.Methods.Count(m => m.Name.ToString()== method.Name.ToString().Split(".").Last()|| m.Name.ToString()== method.Name.ToString())==1){// Make method public
method.Access |= MethodAttributes.Public;
method.Access &= ~MethodAttributes.Private;}// Clear method instructions and exception handlers
method.Body?.ExceptionHandlers?.Clear();
method.Body?.Instructions?.Clear();}
This however used dnlib and I have since decided to switch over to BepInEx.AssemblyPublicizer due to it being much more feature-complete
An example assembly that will generate ambiguity errors is Unity's Animation Rigging package, where the constraint data property becomes ambiguous.
Note: The assembly still compiles, and not every IDE will show the errors, however some others do and it generates a bunch of benign errors which impact DX.
The text was updated successfully, but these errors were encountered:
I can reproduce this with explicit interface implementations, but can you provide any repro code for when it happens with just overriding base class methods?
Publicizing an assembly which contain private methods that are overrides from a base class/interface causes ambiguity errors in certain IDE's (Rider in my case).
I remember fixing this using a custom assembly publicizer a while back by not publicizing the overridden method, and it looked something like this:
An example assembly that will generate ambiguity errors is Unity's Animation Rigging package, where the constraint data property becomes ambiguous.
Note: The assembly still compiles, and not every IDE will show the errors, however some others do and it generates a bunch of benign errors which impact DX.
The text was updated successfully, but these errors were encountered: