Today in Engineer's World, we are
discussing a very important topic of C# in very easy way. Posted By- +Manish Kumar Gautam +LIVE VIAR +ASP.NET SOLUTIONS
Click imagination hunt to
see latest Blogs
Previous – Assembly in.NET
.exe
and .dll in C#
To understand concept of .exe and .dll.
Open up you Visual Studio. And Copy down the steps that we are performing.
Step1: Open a Console Application in VS.
Under main method. Write the code
Step 2: Now Build Solution or Press F6.
You will see the output for this code by
pressing Ctrl+F5
Step 3: Now, go to the project AspnetSolutions
in the Solution Explorer (that is in the upper right hand corner of the VS
window)
Step 4: And if it is missing you can find it in
or you can directly make use of shortcut
keys- Ctrl+W, S.
Step 5: After getting the Solution Explorer
what you have to do is Right Click and Open Folder in File Explorer.
Step 6: Then, click on bin Folder then open the
Debug Folder. You will find that you have a AspnetSolutions project
Application. This appear because you have mentioned some information in Main
Method().
Step 7: If you Right Click on this file to
check its properties. You will find this information, which says- Type of File
is (.exe) i.e. executable file.
Step 8: Now, to see its .dll. Click on the
properties option in the Solution Explorer. In there you will find Output type:
which is Console Application by default. Change it to Class Library and save it
(Ctrl+S).
Figure-8 |
Step 9: Now, Again Build the solution Press F6.
And if you try to see the output for this code as by pressing Ctrl+F5. You will
face this error. Don't worry about this... just read what it says. And you will
yourself understand this till you reach to this Blog end.
Figure-9 |
Step 10: Now, again check the Debug folder, you
will find AspnetSolutions.dll File, i.e. Application Extension.
Figure-10 |
Final Step: If you Right Click on this file to
check its properties. You will find this information, which says- Type of File
is (.dll) i.e. Application Extension.
Figure-11 |
By this we end up.
For any query, comment us below.
Next - First C# Program
Related
Question:
Q-1 What is an
Application Extension?
Ans. Application Extension means it is not
an application. It is an extension of this application that can be used in some
other application.
Q-2 What are
the differences between .exe and .dll?
Q-3 Why is the
reason for the Figure-9 error?
Ans. In this Case as we have change the
Output type from Console Application to Class Library, what happening is- the
.exe file change to .dll file. And we know .dll doesn't contain a Main(), and
if a file is not having a Main() it is never going to be execute, but if you
want to use a .dll you have to use within an .exe.
Click imagination hunt to
see latest Blogs
Keep
learning and sharing...
No comments:
Post a Comment