-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: cannot reduce access in 2.0.15 #219
Comments
Hi, what command/arguments do you pass to ILRepack ? also which version are you using ? |
version 2.0.15 no special flags, just input and output file name. the packed file only fails to run on windows. mono/linux seems to be tolerant of the access tightening that happens on Class3. have you tried to reproduce? |
Thanks. |
looked at the code, just a guess: |
Any action was taken against this issue? |
This is happening to me when packing Npgsql. |
It's happening to me as well in Npgsql (v 4.1.5). Derived method 'Read' in type 'Npgsql.TypeHandlers.TextHandler' from assembly 'Npgsql, Version=4.1.5.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7' cannot reduce access. |
I fixed this in my fork. Waiting for pull request #278 |
@Logerfo @titomor-outsystems I just tried merging version 4.1.5 and it worked fine. How are you invoking it? Here's the output trying to merge it for net461, netstandard2.0 and netcore3.0
|
I ran into this for Npgsql as well, using ilrepack 2.0.18. I created a small sample project that demonstrates the problem here: https://github.com/knutdrofus/ilrepack_npgsql_issue For me, the error appears at runtime, during a type discovery phase during startup, when we're manually feeding types to an IOC container. Not sure if this is a bug or just me using ilrepack incorrectly. |
Also hit this on Program Synthesis: https://www.microsoft.com/en-us/research/project/prose-framework/. In that case, it's for protected method that overrides a parent class' method, and later overriden by a deeper child. Any plan to merge the fix and publish an official nuget? |
Thank you @coderb and @knutdrofus for providing detailed repros! They were very helpful when investigating this. I have a fix ready here: I've verified that it fixes both npgsql as well as the example at the top of this bug. |
@idigra I also verified that PROSE works fine too. |
Great, thanks :) Is an official nuget with the fix planned to be released? |
Yes, stay tuned |
@KirillOsenkov do you plan update Mono.Cecil to latest version? |
Yes, will do a bunch of modernization and go through the outstanding PRs and bugs as time allows |
Try this fix out: https://www.nuget.org/packages/ILRepack/2.0.22 |
The following code fails when run through ilrepack on windows. the error is
Unhandled Exception: System.TypeLoadException: Derived method 'Meth' in type 'TestIlRepack.ArrayHandler``1' from assembly 'x, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' cannot reduce access.
The method in
Class3
is having its access changed tointernal
frompublic
while the base class remainspublic
.The text was updated successfully, but these errors were encountered: