That is the assembly developed in C #.net can be used in Vb .net and ASP.net also and vice versa.
Interested in mastering .NET? Learn more about ".NET Training" in this blog post.
Go to project menu Add reference Browse choose a DLL file
Note: - To develop assemblies .net introduced class library project template
Note:- DLL files are not executable, only it contains reusable code.
For every project, by default, a namespace will be created with the name of the project.
Namespace private e test
{
Public class test
{
Public string M1 ()
{
Return “form M1”;
}
//M1
}
//test
}
Namespace sub private Test
{
Public class test 2
{
Public String Print ()
{
Return “from print”;
}
//print
Public string PRINT ()
{
Return “from PRINT”;
}
//print
}
//test2
}//sub private test
}
//private test Build the project (build menu build solution)
Private test. DLL is created under D:/C194 /private test / bin / debug folder with the following Structure
Similar to System. Io
Using private test;
both should be returned if one write, Using private test. Sub private Test;
then only that namespace classes all user
// code for button
{
Test t = new test ();
Message Box . show (t. M1());
Test 2 S = new Test 2 ();
Message Box . show (S. Print ());
Message Box . show (S. Print ());
}
When the project is executed then private Test. DLL is copied into C :/c 194/Ctest/Bin/debug folder, hence private Test. DLL is a private assembly.
open vb.net windows Application Project with name V Test.
Project Menu
Add reference
Browse
Private Test.
DLL Place a button Imports Private Test
Imports Private Test. Sub Private Test //code for b1_click Dim t As New Test Message Box (t1. M1()) Dim S As New Test2 Message Box (S. print ())//can not be called.
Note: - Test 2 is having two methods with name print and PRINT where the only case is different. This type of method is not accessible from VB.net because VB.net is not case sensitive.
C:/Windows/Assembly
GAC – Global Assembly cache
Sn – K abc.snk Small case
Gacutil -I dll file
-u uninstall
Namespace ABC 123 { Public Class Test { Public String Get Test () { Return “from get text”; }//get text }//text }//ABC 123
(Start Programs Microsoft Visual Studio 2008 Visual Studio Tools visual Studio 2008 command prompt ) D: enter key
Abc 123 >cd bin Abc 123/bin > cd debug
OBS:-
Abc.snk file is created with a strong name linking abc.snk in the current project Project menu
Abc 123 Properties
Signing
check the “Sign the assembly” checkbox
Select “browse” from the combo box
choose ABC.snk file
Project menu
ABC 123 Properties
Application
Click on the Assembly Information button and type some information.
Build the project (build build Solution)
OBS:-
ABC 123. DLL is created under D:/c194 /ABC 123 / Bin /Debug folder Open .net command prompt and type as follows Gacutil – I abc 123.dll
OBS:-
ABC 123. DLL is registered with GAC (C :/windows/Assembly) hence it is called as shared Assembly.
Open windows Forms Application Project with Project name WINTEST Project menu
Add reference
Browse
Abc 123.dll Place a Button Using ABC 123 Namespace WINTEST
Code for Button1_click
{
Test t = new Test ();
Message Box. Show (t. Get Text ());
}
Execute the Project (f5)
ABC123.DLL is not copied into D :/ c194/WINTEST/bin /Debug folder, hence Abc 123.DLL is a Shared Assembly
All predefined assemblies are shared assemblies
You liked the article?
Like: 0
Vote for difficulty
Current difficulty (Avg): Medium
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.