You cannot change attributes at runtime. They are embedded into the metadata of the assembly. Your method is changing the internal state of a particular instance; but when you load the attribute again, you are getting a different instance.
More Related Contents:
- Create object instance of a class from its name in string variable
- Find methods that have custom attribute using reflection
- How do I get the path of the assembly the code is in?
- Set object property using reflection
- How can I evaluate C# code dynamically?
- How to Load an Assembly to AppDomain with all references recursively?
- How can I get all classes within a namespace?
- How to get a list of properties with a given attribute?
- Call static method with reflection
- What’s the difference between System.Type and System.RuntimeType in C#?
- Use reflection to invoke an overridden base method
- Fast creation of objects instead of Activator.CreateInstance(type)
- Get a generic method without using GetMethods
- Custom attribute on property – Getting type and value of attributed property
- Resolve Type from Class Name in a Different Assembly
- ‘casting’ with reflection
- How can you loop over the properties of a class?
- GetEntryAssembly for web applications
- Why is TargetInvocationException treated as uncaught by the IDE?
- Finding all Namespaces in an assembly using Reflection (DotNET)
- Get all properties which marked certain attribute
- Using GetProperties() with BindingFlags.DeclaredOnly in .NET Reflection
- Comparing Object properties using reflection
- Winforms TableLayoutPanel adding rows programmatically
- Implementations of interface through Reflection
- IsAssignableFrom() returns false when it should return true
- How to recursively print the values of an object’s properties using reflection
- Get derived class type from a base’s class static method
- How to use Activator to create an instance of a generic Type and casting it back to that type?
- Run a method before all methods of a class