Coder Social home page Coder Social logo

Comments (6)

SimonCropp avatar SimonCropp commented on August 23, 2024 1

currently undocumented, but u can call VerifierSettings.InitializePlugins(); which will do a dll scan and call initialize on all verify plugins

from verify.icsharpcode.decompiler.

SimonCropp avatar SimonCropp commented on August 23, 2024

this is problematic for a couple of reasons

  • it is desirable to be able to Verify ICSharpCode directly. ie i would prefer to have to remember to call VerifyICSharpCodeDecompiler.Enable once ather than remember that i always need to pass in a custom type that exists in Verify.ICSharpCode.Decompiler just to get the side effect of a hidden VerifyICSharpCodeDecompiler.Enable.
  • there is an ecosystem of extensions that all use the "enable in module init" pattern

from verify.icsharpcode.decompiler.

tom-englert avatar tom-englert commented on August 23, 2024

Actually I don't see why this is a problem.

  • When you pass in a custom type to Verify (e.g. await Verify(new TypeToDisassemble(file, type))), it requires that this custom type is registered.
  • If the type is not registered, there is no warning or error, it's just not working at all, which is very annoying.

So why not ensure that if you use such a custom type, it simply ensures that it's registered with Verify.

It does not break any other use case, just makes it more seamless to use. You can still can call Enable by your own, if you like, and everything else will work the same, no matter if the types are registered or not.

Since this pattern is used in other extensions, too, maybe there should be a more global solution, like e.g. in Serilog where they look for such registration methods via reflection in all loaded assemblies?

from verify.icsharpcode.decompiler.

SimonCropp avatar SimonCropp commented on August 23, 2024

but await Verify(new AssemblyToDisassemble(file)) requires people to always remember to use AssemblyToDisassemble every single time they verify an assembly. ie this wont work

using var file = new PEFile(assembly2Path);
await Verify(file);

from verify.icsharpcode.decompiler.

tom-englert avatar tom-englert commented on August 23, 2024

So we make every days life harder, just to optimize one very rare edge case?

from verify.icsharpcode.decompiler.

SimonCropp avatar SimonCropp commented on August 23, 2024

"passing the actual type from the underlying library" is not a rare edge case. it is how the majority of verification happens

from verify.icsharpcode.decompiler.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.