I have a class library in C# which is compiled into a dll. Is it possible to change something in a compiled class method for a specific project without touching the original source code or creating a new class by inheritance?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s technically possible using code rewriting via a technique used by frameworks like Moles. However, I wouldn’t recommend this. Instead, you’d be better off with an wrapper class that delegates calls to a contained object and overrides the behavior you’re after for only the specific methods that must change.