I always thought I was a talented person. I only know it today. I am a genius! The following problem is solved.
In the previous article, I spoke about my initial knowledge of assembly.
Now let's talk about how to use the existing assembly.
For example, when I am working on a solution, I find that the class methods (functions) in a project of the solution you are working on can be used. Ha, then I don't need to write classes, pass the test directly,Not TestCodeFile, but the assembly of the project to be tested... I will solve this problem now.
Process]
① Open the solution, right-click the project in Solution Explorer, and choose add reference. The add reference dialog box is displayed, and click browse ], find and select the Assembly just copied from you, (assume: classlibrary_ax) → [open] → [OK]
Now, you can use your class !!!!!
② Of course, do not forget the reference: Using classlibrary_ax;
OK !!!! Use the classes in assembly as much as possible.
For example:
③ For cainiao, it may still be unclear about the classes contained in Assembly. Please follow the instructions
④ For the functional explanations of the methods in these classes, you will see them when using them. See
Sorry, I didn't write the corresponding comments when writing the method, and I couldn't see what the method is for. Of course, you can see that it is a method for calculating the prize, the return value is a double type.
It can be seen that writing code without comments is not feasible. unreadable code is garbage.
Append: ide automatically copies the assembly to the debug folder of your current project.