Skip to content
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

Library for reading CLI assemblies #89

Open
benjamin-hejl opened this issue Dec 9, 2022 · 0 comments
Open

Library for reading CLI assemblies #89

benjamin-hejl opened this issue Dec 9, 2022 · 0 comments
Labels
bug Something isn't working code quality Increase the quality of the code

Comments

@benjamin-hejl
Copy link
Collaborator

dnlib is great, it offers complete representation of CLI assemblies. But it has some issues, mainly with regards to resolving built-in types in modern .net (.net5,6,7 - 0xd4d/dnlib#453). Some dirty hack is applied here to ensure types are loaded, but it does not work for all types and in all versions of .net. Test dnWalker.Tests.Examples.CaptureOutputTests2 fails for .net6.0 a .net7.0 due to this issue.

  1. Make the fix work for all versions? Fix the custom implementation of dnlib.DotNet.IResolver or make a better hack to resolve currently unresolved types.
  2. Resolve the issue within dnlib itself
  3. Use another library for reading CLI assemblies?
    Built-in System.Reflection could be a good choice, because it would make referencing built-in types much easier (with the typeof() expression) . But it does not parse instructions as dnlib does, some kind of instruction stream parser would have had to be created. Also the tested assemblies should not be loaded into the appdomain directly due to safety issues, only in read-only mode - this could make the before mentioned advantages void.
    If another library is used, it could prove better to setup custom abstraction layer for types, methods, fields etc.
@benjamin-hejl benjamin-hejl added bug Something isn't working code quality Increase the quality of the code labels Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working code quality Increase the quality of the code
Projects
None yet
Development

No branches or pull requests

1 participant