Kirk
Kirk

Reputation: 89

.NET Reflector - Reflexil, Change private to public

I have an assembly loaded into .NET reflector and I have the reflexil addin. I found a method in the assembly but it's private. Copying the whole method to my code is too much work because it uses many other methods in the assembly. I just want to change

private void Check(string Proxy, int Port)

to

public void Check(string Proxy, int Port)

So I can use it in my code. Does anybody know how to change it and how to save the fixed assembly after that?

Kirk

Upvotes: 3

Views: 2149

Answers (1)

Tim Lloyd
Tim Lloyd

Reputation: 38454

Instead of re-writing the assembly, consider using Reflection from your code to invoke the private method dynamically, see:

How do I use reflection to invoke a private method?

Upvotes: 1

Related Questions