microsoft / referencesource

Source from the Microsoft .NET Reference Source that represent a subset of the .NET Framework
https://referencesource.microsoft.com/
MIT License
3.17k stars 1.27k forks source link

__DynamicallyInvokableAttribute #112

Closed Backup-eric645 closed 1 year ago

Backup-eric645 commented 5 years ago

I know there is a class, a compiler symbol class, called __DynamicallyInvokableAttribute, in the .NET Framework. It has been decompiled on a Telerik tool.

I then wanted to use it in my projects.

Make that __DynamicallyInvokableAttribute non-internal to let me use it in my own projects.

It is defined at the Default Namespace in all assemblies in the .NET Framework.

The new version of the .NET framework should be called 4.8.1 Modification.

SamB commented 4 years ago

That would actually be completely useless; the source says:

// Each blessed API will be annotated with a "__DynamicallyInvokableAttribute".
// This "__DynamicallyInvokableAttribute" is a type defined in its own assembly.
// So the ctor is always a MethodDef and the type a TypeDef.
// We cache this ctor MethodDef token for faster custom attribute lookup.
// If this attribute type doesn't exist in the assembly, it means the assembly
// doesn't contain any blessed APIs.

So if it's not in your assembly, it won't do anything.

terrajobst commented 1 year ago

This repository does not accept feature requests or bug reports. To submit those, you need to go elsewhere: