Step on a token: use the default parameter with caution, and use the parameter with caution.
I always thought. net compiler will compile the default parameters into the reload mode for the main DLL call, until recently want to extend a method does not want to affect the previous call, so added the default parameter. Who knows how to compile and release the DLL where the Method is located and find that the program directly throws an exception that cannot find the Method. After that, I compiled the dll of the main call and found that it can be used again. What is this?
Write a Demo to verify it:
Let's take a look at the running result:
Let's take a look at what IL looks like:
Your sister's original compiler directly calls the default parameter method by assigning the default value to the main DLL, rather than using the overload !!!
So if the method you want to expand has multiple DLL calls, and you do not want to submit so many DLL, You Should reload it yourself and use the default parameter with caution.
I am busy playing Dota in the morning. I didn't see that I didn't set the default parameter. It's just a problem. Sweat! Silly
Updated. Thank you for reminding me.