Escolar Documentos
Profissional Documentos
Cultura Documentos
Bibek Kumar
CSE Deptt. DITU
bibek.kumar@dituniversity.edu.in
INDEX
• Introduction to .NET
• .NET Framework.
• Features of .NET framework.
• Component of .NET Framework
• Elements of .NET
• Assembly and its types
• Creating Shared assembly
• Creating DLL Files
It defines a set of rules and restrictions that every language must follow
which runs under .NET framework.
This is done in such a way, that programs written in any language can
interoperate with other languages.
This also can take full advantage of inheritance, polymorphism,
exceptions and other features.
Bibek Kumar, Assistant Professor , CSE Deptt., DTU Dehradun
Elements of .NET
Step 1: Generate a key file. Open a VS command prompt. Go into your folder and
generate a key file as:
<drive>:\<folder> sn -k key.snk
Step 2: create a project and associate a key file to it before compilation so that the
generated assembly will be strong named.
Open a new project of type class library and name it sAssembly; under class1 write
the following:
Step 4: Testing
Open a new project add a reference to Assembly.dll and write the following code for
the button click event.
Run the project and verify under the bin/debug folder of the current project where
we will not find a copy of the Assembly.dll as it is a shared assembly.
Bibek Kumar, Assistant Professor , CSE Deptt., DTU Dehradun
Create DLL Files
You need to make a class library and not a Console Application. The console
application is translated into an .exe whereas the class library will then be compiled
into a dll which you can reference in your windows project.
• Right click on your Console Application -> Properties -> Change the Output type
to Class Library
DLL files cannot be run just like normal application (exe) files. You'll need to create a
separate project (probably a win forms app) and then add your dll file to that project
as a "Reference", you can do this by going to the Solution explorer, right clicking your
project Name and selecting Add Reference then browsing to where ever you saved
your dll file.