Not possible to instantiate an internal endpoint interface from a signed assembly
Description RestEase has a problem when i want to instantiate a client for an internal interface from a signed assembly.
In this case it is not possible to add an InternalsVisibleTo attribute which only contains the assembly name (RestClient.FactoryAssemblyName) it also must contain a public key.
Unfortunately RestEase completely ignores the public key when checking the attribute (https://github.com/canton7/RestEase/blob/00dfdfba00e12811b31f8063f742af4acaf41fda/src/RestEase/Implementation/ReflectionTypeAnalyzer.cs#L105) and it requires the assembly name to be RestClient.FactoryAssemblyName, which leads to compile time error.
Instead the check should ensure that either the assembly name equals RestClient.FactoryAssemblyName or assembly name starts with RestClient.FactoryAssemblyName followed by ', PublicKey='.
This would cover all cases for sined and unsigned assemblies and for public and internal interfaces
To Reproduce Create new project, add a key to automatically sign it. Add RestEase package and create a new internal inteface for an endpoing. When instantiating the interface service with RestClient you will get an error.
Version Info
- RestEase version: 1.6.4
- Target framework version: .Net Framework 4.6.1