vendredi 7 octobre 2022

Is there a mechanism to disable Reflection in .NET 6?

I am writing an extensible server application. I’d like to expose a library that can be consumed by a third party to write extensions to the server application. When I load the 3rd parties assembly I want to block loading it if the assembly uses Reflection.

The goal is to allow the 3rd party library developer to implement server interfaces and the server will execute those implementations, but will block loading the assembly if reflection is used.

The purpose behind this is to maintain a reasonable level of security when loading a 3rd party assembly into the server. I.E. the 3rd party assembly should be restricted and unable to use reflection to gain access to other parts of the application.

I read about assembly Evidence, but I don’t know if that will allow me to glean the information I need to know.





Aucun commentaire:

Enregistrer un commentaire